Lint and fix some subtle bugs

This commit is contained in:
Roberto Cosenza 2021-06-23 11:51:37 +01:00 committed by Andrius Štikonas
parent dbda9b4157
commit f8803a7b15
3 changed files with 7 additions and 4 deletions

View File

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

View File

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

View File

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