Skip to content

Commit

Permalink
Merge pull request #21 from andrey-git/pure_conf
Browse files Browse the repository at this point in the history
Full set Pure Boost
  • Loading branch information
gjohansson-ST authored Jun 5, 2022
2 parents cc7bb80 + 8b2f745 commit 17821e1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 16 additions & 1 deletion pysensibo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ async def async_get_devices_data(self) -> SensiboData:
pure_ac_integration: bool | None = None
pure_geo_integration: bool | None = None
pure_measure_integration: bool | None = None
pure_prime_integration: bool | None = None
if dev["productModel"] == "pure":
pure_boost_enabled = pure_conf.get("enabled", False)
pure_sensitivity = pure_conf.get("sensitivity", "off")
pure_sensitivity = pure_conf.get("sensitivity", "n").lower()
pure_ac_integration = pure_conf.get("ac_integration", False)
pure_geo_integration = pure_conf.get("geo_integration", False)
pure_measure_integration = pure_conf.get(
"measurements_integration", False
)
pure_prime_integration = pure_conf.get("prime_integration", False)
pm25 = measure.get("pm25")

# Binary sensors for main device
Expand Down Expand Up @@ -278,6 +280,8 @@ async def async_get_devices_data(self) -> SensiboData:
pure_ac_integration=pure_ac_integration,
pure_geo_integration=pure_geo_integration,
pure_measure_integration=pure_measure_integration,
pure_prime_integration=pure_prime_integration,
pure_conf=pure_conf,
pm25=pm25,
room_occupied=room_occupied,
update_available=update_available,
Expand Down Expand Up @@ -441,6 +445,17 @@ async def async_set_calibration(
APIV2 + "/pods/{}/calibration/".format(uid), params, data
)

async def async_set_pureboost(
self, uid: str, data: dict[str, float]
) -> dict[str, Any]:
"""Set Pure Boost Settings.
uid: UID for device
data: dict as pure_conf
"""
params = {"apiKey": self.api_key}
return await self._put(APIV2 + "/pods/{}/pureboost".format(uid), params, data)

async def async_set_ac_states(
self,
uid: str,
Expand Down
2 changes: 2 additions & 0 deletions pysensibo/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class SensiboDevice:
pure_ac_integration: bool | None
pure_geo_integration: bool | None
pure_measure_integration: bool | None
pure_prime_integration: bool | None
pure_conf: dict[str, Any] | None
timer_on: bool | None
timer_id: str | None
timer_state_on: bool | None
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
print(find_packages())
setup(
name="pysensibo",
version="1.0.16",
version="1.0.17",
description="asyncio-friendly python API for Sensibo",
long_description="asyncio-friendly python API for Sensibo"
"(https://sensibo.com). Requires Python 3.4+",
Expand Down

0 comments on commit 17821e1

Please sign in to comment.