forked from M-Labs/thermostat
Compare commits
10 Commits
953a48230c
...
f7ad053433
Author | SHA1 | Date | |
---|---|---|---|
f7ad053433 | |||
a9e7fbc394 | |||
c5ad9a355e | |||
3648cab1f8 | |||
8568ed59eb | |||
7e78d987eb | |||
a412679d43 | |||
a99f0c9870 | |||
c1b5931f6b | |||
5bbe8a06c6 |
@ -139,11 +139,7 @@ class AsyncioClient:
|
||||
"""
|
||||
return await self._get_conf("postfilter")
|
||||
|
||||
async def get_fan(self):
|
||||
"""Get Thermostat current fan settings"""
|
||||
return await self._command("fan")
|
||||
|
||||
async def report(self):
|
||||
async def get_report(self):
|
||||
"""Obtain one-time report on measurement values
|
||||
|
||||
Example of yielded data:
|
||||
@ -164,6 +160,18 @@ class AsyncioClient:
|
||||
"""
|
||||
return await self._command("report")
|
||||
|
||||
async def get_ipv4(self):
|
||||
"""Get the IPv4 settings of the Thermostat"""
|
||||
return await self._command("ipv4")
|
||||
|
||||
async def get_fan(self):
|
||||
"""Get Thermostat current fan settings"""
|
||||
return await self._command("fan")
|
||||
|
||||
async def get_hwrev(self):
|
||||
"""Get Thermostat hardware revision"""
|
||||
return await self._command("hwrev")
|
||||
|
||||
async def set_param(self, topic, channel, field="", value=""):
|
||||
"""Set configuration parameters
|
||||
|
||||
@ -182,14 +190,6 @@ class AsyncioClient:
|
||||
value = str(value)
|
||||
await self._command(topic, str(channel), field, value)
|
||||
|
||||
async def set_fan(self, power="auto"):
|
||||
"""Set fan power"""
|
||||
await self._command("fan", str(power))
|
||||
|
||||
async def set_fcurve(self, a=1.0, b=0.0, c=0.0):
|
||||
"""Set fan curve"""
|
||||
await self._command("fcurve", str(a), str(b), str(c))
|
||||
|
||||
async def power_up(self, channel, target):
|
||||
"""Start closed-loop mode"""
|
||||
await self.set_param("pid", channel, "target", value=target)
|
||||
@ -207,10 +207,6 @@ class AsyncioClient:
|
||||
if channel == "":
|
||||
await self._read_line() # Read the extra {}
|
||||
|
||||
async def hw_rev(self):
|
||||
"""Get Thermostat hardware revision"""
|
||||
return await self._command("hwrev")
|
||||
|
||||
async def reset(self):
|
||||
"""Reset the Thermostat
|
||||
|
||||
@ -222,7 +218,7 @@ class AsyncioClient:
|
||||
|
||||
await self.disconnect()
|
||||
|
||||
async def dfu(self):
|
||||
async def enter_dfu_mode(self):
|
||||
"""Put the Thermostat in DFU mode
|
||||
|
||||
The client is disconnected as the Thermostat stops responding to
|
||||
@ -235,6 +231,10 @@ class AsyncioClient:
|
||||
|
||||
await self.disconnect()
|
||||
|
||||
async def ipv4(self):
|
||||
"""Get the IPv4 settings of the Thermostat"""
|
||||
return await self._command("ipv4")
|
||||
async def set_fan(self, power="auto"):
|
||||
"""Set fan power"""
|
||||
await self._command("fan", str(power))
|
||||
|
||||
async def set_fcurve(self, a=1.0, b=0.0, c=0.0):
|
||||
"""Set fan curve"""
|
||||
await self._command("fcurve", str(a), str(b), str(c))
|
||||
|
@ -39,7 +39,7 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
|
||||
async def start_session(self, host, port):
|
||||
await self._client.connect(host, port)
|
||||
self.hw_rev = await self._client.hw_rev()
|
||||
self.hw_rev = await self._client.get_hwrev()
|
||||
|
||||
@asyncSlot()
|
||||
async def end_session(self):
|
||||
@ -92,7 +92,7 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
) = await asyncio.gather(
|
||||
self._client.get_fan(),
|
||||
self._client.get_output(),
|
||||
self._client.report(),
|
||||
self._client.get_report(),
|
||||
self._client.get_pid(),
|
||||
self._client.get_b_parameter(),
|
||||
self._client.get_postfilter(),
|
||||
@ -109,7 +109,7 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
await self._client.set_param("ipv4", ipv4)
|
||||
|
||||
async def get_ipv4(self):
|
||||
return await self._client.ipv4()
|
||||
return await self._client.get_ipv4()
|
||||
|
||||
@asyncSlot()
|
||||
async def save_cfg(self, ch=""):
|
||||
@ -120,7 +120,7 @@ class Thermostat(QObject, metaclass=PropertyMeta):
|
||||
await self._client.load_config(ch)
|
||||
|
||||
async def dfu(self):
|
||||
await self._client.dfu()
|
||||
await self._client.enter_dfu_mode()
|
||||
|
||||
async def reset(self):
|
||||
await self._client.reset()
|
||||
|
Loading…
Reference in New Issue
Block a user