Browse Source

Lint and fix some subtle bugs

master
Roberto Cosenza 3 months ago
committed by Andrius Štikonas
parent
commit
f8803a7b15
  1. 1
      neohubapi/enums.py
  2. 7
      neohubapi/neohub.py
  3. 3
      neohubapi/neostat.py

1
neohubapi/enums.py

@ -46,6 +46,7 @@ class Weekday(enum.Enum):
SATURDAY = "saturday"
SUNDAY = "sunday"
class HCMode(enum.Enum):
AUTO = "AUTO"
COOLING = "COOLING"

7
neohubapi/neohub.py

@ -171,13 +171,16 @@ class NeoHub:
message = {"SET_TEMP_FORMAT": temp_format}
reply = {"result": f"Temperature format set to {temp_format}"}
result = await self._send(message, reply)
return result
async def set_hc_mode(self, hc_mode: HCMode, devices: [NeoStat]):
"""
Set hc_mode to AUTO or...
"""
names = self._devices_to_names(devices)
message = {"SET_HC_MODE": [hc_mode.value, names]}
reply = {"result": f"HC_MODE was set"}
reply = {"result": "HC_MODE was set"}
result = await self._send(message, reply)
return result
@ -560,5 +563,3 @@ class NeoHub:
result = await self._send(message, reply)
return result

3
neohubapi/neostat.py

@ -8,6 +8,7 @@ from types import SimpleNamespace
from async_property import async_property
from neohubapi.enums import HCMode
from neohubapi.enums import Weekday
@ -165,7 +166,7 @@ class NeoStat(SimpleNamespace):
result = await self._hub.set_target_temperature(temperature, [self])
return result
async def set_hc_mode(self, hc_mode: str):
async def set_hc_mode(self, hc_mode: HCMode):
result = await self._hub.set_hc_mode(hc_mode, [self])
return result

Loading…
Cancel
Save