Skip to content

Commit

Permalink
Ignore not-yet-supported notifications of node profile class
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Sep 25, 2022
1 parent 8fb055e commit 9190117
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pychonet/echonetapiclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ async def echonetMessageReceived(self, raw_data, addr):
# handle discovery message response
for opc in processed_data["OPC"]:
epc = opc["EPC"]
if seojgc == 14 and seojcc == 240 and (epc == INSTANCE_LIST or epc == ENL_MANUFACTURER or epc == ENL_UID): # process discovery data
await self.process_discovery_data(host, opc)
if seojgc == 0x0E and seojcc == 0xF0:
if (epc in [INSTANCE_LIST, ENL_MANUFACTURER, ENL_UID]): # process discovery data
await self.process_discovery_data(host, opc)
else:
# @todo handling others (0x05: Notify of change instance list, etc...)
continue
elif host not in self._state: # echonet packet arrived we dont know about
if self._debug_flag:
self._logger(f"Unknown ECHONETLite node has been identified at {host} - discovery packet fired")
Expand Down

3 comments on commit 9190117

@tom3q
Copy link
Contributor

@tom3q tom3q commented on 9190117 Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nao-pon, thanks so much for continuing the development of the pychonet and the home assistant echonetlite integration.
Would it be possible for future commits to add 1-2 sentences of a description in the commit message, to let other potential contributors understand the background behind the changes? (e.g. What was wrong before? How did you find it? etc.)

Thanks,
Tomasz

@nao-pon
Copy link
Collaborator Author

@nao-pon nao-pon commented on 9190117 Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi tom3q, This change wasn't a problem, but during the refactoring process I discovered something that I would like to implement in the future, so I've noted it.

And today I added detailed annotations.

if seojgc == 0x0E and seojcc == 0xF0: # Node Profile Class Response
if (epc in [INSTANCE_LIST, ENL_MANUFACTURER, ENL_UID]): # process discovery data
await self.process_discovery_data(host, opc)
else:
# @todo handling others
'''
Ex. 0x05: Instance list notification
A property to announce the configuration of instances to be disclosed to the network at startup.
This property also announces instances held at the self-node each time the configuration of
instances disclosed to the network is changed during system operation, such as instance
addition or deletion.
'''
'''
It is desirable to dynamically add and delete entities when there is an increase
or decrease in the number of instances within a device already configured with HA,
but that will be an issue for the future.
'''
continue

@tom3q
Copy link
Contributor

@tom3q tom3q commented on 9190117 Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation! My thought is that it would be nice to have some short explanation for every commit, so people, like me, looking at the development history can understand the background behind the changes. :)

Please sign in to comment.