fix linting error
This commit is contained in:
parent
10f96b2ccf
commit
a73dc49258
@ -281,14 +281,15 @@ class IoTBackend(BaseBackend):
|
|||||||
def list_things(self, attribute_name, attribute_value, thing_type_name, max_results, token):
|
def list_things(self, attribute_name, attribute_value, thing_type_name, max_results, token):
|
||||||
all_things = [_.to_dict() for _ in self.things.values()]
|
all_things = [_.to_dict() for _ in self.things.values()]
|
||||||
if attribute_name is not None and thing_type_name is not None:
|
if attribute_name is not None and thing_type_name is not None:
|
||||||
filtered_things = list(
|
filtered_things = list(filter(lambda elem:
|
||||||
filter(
|
attribute_name in elem["attributes"] and
|
||||||
lambda elem: attribute_name in elem["attributes"] and elem["attributes"][
|
elem["attributes"][attribute_name] == attribute_value and
|
||||||
attribute_name] == attribute_value and "thingTypeName" in elem and elem[
|
"thingTypeName" in elem and
|
||||||
"thingTypeName"] == thing_type_name, all_things))
|
elem["thingTypeName"] == thing_type_name, all_things))
|
||||||
elif attribute_name is not None and thing_type_name is None:
|
elif attribute_name is not None and thing_type_name is None:
|
||||||
filtered_things = list(filter(lambda elem: attribute_name in elem["attributes"] and elem["attributes"][
|
filtered_things = list(filter(lambda elem:
|
||||||
attribute_name] == attribute_value, all_things))
|
attribute_name in elem["attributes"] and
|
||||||
|
elem["attributes"][attribute_name] == attribute_value, all_things))
|
||||||
elif attribute_name is None and thing_type_name is not None:
|
elif attribute_name is None and thing_type_name is not None:
|
||||||
filtered_things = list(
|
filtered_things = list(
|
||||||
filter(lambda elem: "thingTypeName" in elem and elem["thingTypeName"] == thing_type_name, all_things))
|
filter(lambda elem: "thingTypeName" in elem and elem["thingTypeName"] == thing_type_name, all_things))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user