Skip to content

Commit

Permalink
Don't call update callback functions in discover()
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Feb 22, 2024
1 parent bb67ff3 commit 44f6ce9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pychonet/echonetapiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,11 @@ async def echonetMessage(self, host, deojgc, deojcc, deojci, esv, opc):
no_res = True if esv is SETI else False
payload = None
# Is node profile
is_node_profile = deojgc == 0x0E and deojcc == 0xF0
is_discover = deojgc == 0x0E and deojcc == 0xF0
map_epcs = {ENL_STATMAP, ENL_GETMAP, ENL_SETMAP}
# Check OPC Code
try:
if not is_node_profile:
if not is_discover:
if esv == GET:
check_map = set(
self._state[host]["instances"][deojgc][deojcc][deojci].get(
Expand Down Expand Up @@ -313,7 +313,7 @@ async def echonetMessage(self, host, deojgc, deojcc, deojci, esv, opc):
# if tx_tid is not in message list then the message listener has received the message
if self._message_list.get(tx_tid) is None:
# Check OPC count in results
if not is_node_profile and tx_tid in self._opc_counts:
if not is_discover and tx_tid in self._opc_counts:
res_opc_count = self._opc_counts[tx_tid]
del self._opc_counts[tx_tid]
if self._debug_flag:
Expand All @@ -335,7 +335,7 @@ async def echonetMessage(self, host, deojgc, deojcc, deojci, esv, opc):
if not is_success:
if self._message_list.get(tx_tid) is not None:
del self._message_list[tx_tid]
if self._state[host]["available"] != not_timeout:
if not is_discover and self._state[host]["available"] != not_timeout:
self._state[host]["available"] = not_timeout
# Call update callback functions
# key is f"{host}-{deojgc}-{deojcc}-{deojci}"
Expand Down

0 comments on commit 44f6ce9

Please sign in to comment.