Skip to content

Commit

Permalink
Fix send_state naming
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenbe committed May 24, 2024
1 parent 54aa0bd commit 8249a49
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions comfospot40/hal.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ async def setup(self, devpath: str):
)
self.parser = Parser(self._reader, None, self._state)

async def sendState(self, state: State, timer):
async def send_state(self, state: State, timer):
dirtimer = timer - self._oscillation_switch
switch_dir = dirtimer > self._oscillation_time
# print("sendState", timer, switch_dir)
if switch_dir:
self._oscillation_switch = timer
for zoneid, zonestate in state.zones.items():
Expand Down
2 changes: 1 addition & 1 deletion comfospot40/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def subscribe(self):
await self._client.subscribe(subscribe_topic)
self.topics.append((subscribe_topic, subscribe_callback))

def sendState(self, state):
def send_state(self, state):
for _, zonestate in state.zones.items():
for attr in (
"inside_temperature",
Expand Down
4 changes: 2 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ async def main(
await mqtt.subscribe()
last_print = 0
while True:
mqtt.sendState(state)
mqtt.send_state(state)
new_print = time.monotonic()
await hal.sendState(state, new_print)
await hal.send_state(state, new_print)
if storestate:
with open(storestate, "w") as storefile:
hal.storeState(storefile, state)
Expand Down

0 comments on commit 8249a49

Please sign in to comment.