Skip to content

Commit

Permalink
fix: return entity options in get_available_entities (#14)
Browse files Browse the repository at this point in the history
Filter out null properties in response message.
  • Loading branch information
zehnm authored Feb 27, 2024
1 parent b82730f commit bae863d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ucapi/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@ def get_all(self) -> list[dict[str, Any]]:
"device_id": entity.device_id,
"features": entity.features,
"name": entity.name,
"area": entity.area,
"device_class": entity.device_class,
}
if entity.device_class:
res["device_class"] = entity.device_class
if entity.options:
res["options"] = entity.options
if entity.area:
res["area"] = entity.area

entities.append(res)

Expand Down

0 comments on commit bae863d

Please sign in to comment.