mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 19:25:12 +02:00
Address review items and potentially unexpected normalize behavior with jsonpath
This commit is contained in:
@@ -219,7 +219,7 @@ class RestSensor(Entity):
|
|||||||
json_dict = json.loads(value)
|
json_dict = json.loads(value)
|
||||||
if self._json_attrs_path is not None:
|
if self._json_attrs_path is not None:
|
||||||
json_dict = jsonpath(json_dict, self._json_attrs_path)
|
json_dict = jsonpath(json_dict, self._json_attrs_path)
|
||||||
if isinstance(json_dict, list):
|
elif isinstance(json_dict, list):
|
||||||
json_dict = json_dict[0]
|
json_dict = json_dict[0]
|
||||||
if isinstance(json_dict, dict):
|
if isinstance(json_dict, dict):
|
||||||
attrs = {
|
attrs = {
|
||||||
|
Reference in New Issue
Block a user