Skip to content

Commit

Permalink
Merge pull request #68 from andrey-git/pure-pm25
Browse files Browse the repository at this point in the history
Fix pm25 for pure device
  • Loading branch information
gjohansson-ST authored Jul 16, 2024
2 parents 775aa86 + 6e9e15a commit 7212e3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pysensibo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,12 @@ async def async_get_devices_data(self) -> SensiboData: # noqa: C901
"measurements_integration", False
)
pure_prime_integration = pure_conf.get("prime_integration", False)
pm25 = measure.get("pm25")
if dev["productModel"] != "pure":
pm25 = measure.get("pm25")
pm25_pure = measure.get("pm25")
else:
pm25 = measure.get("pm25")
pm25_pure = measure.get("pm25")

# Binary sensors for main device
room_occupied = dev["roomIsOccupied"]
Expand Down Expand Up @@ -389,6 +394,7 @@ async def async_get_devices_data(self) -> SensiboData: # noqa: C901
pure_prime_integration=pure_prime_integration,
pure_conf=pure_conf,
pm25=pm25,
pm25_pure=pm25_pure,
room_occupied=room_occupied,
update_available=update_available,
filter_clean=filter_clean,
Expand Down
1 change: 1 addition & 0 deletions pysensibo/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class SensiboDevice:
full_capabilities: dict[str, Any]
motion_sensors: dict[str, MotionSensor] | None
pm25: float | None
pm25_pure: int | None
room_occupied: bool
update_available: bool
schedules: dict[str, Schedules] | None
Expand Down

0 comments on commit 7212e3b

Please sign in to comment.