Lint and fix some subtle bugs
This commit is contained in:
parent
dbda9b4157
commit
f8803a7b15
|
@ -46,6 +46,7 @@ class Weekday(enum.Enum):
|
|||
SATURDAY = "saturday"
|
||||
SUNDAY = "sunday"
|
||||
|
||||
|
||||
class HCMode(enum.Enum):
|
||||
AUTO = "AUTO"
|
||||
COOLING = "COOLING"
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue