Address review items and potentially unexpected normalize behavior with jsonpath
parent
648aa5f969
commit
fe9e179092
|
@ -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 = {
|
||||||
|
|
Loading…
Reference in New Issue