greghesp/pybambu

event_ams_info_update event_type not firing on tray changes

Opened this issue · 0 comments

It seems the event_ams_info_update event_type is only fired when there are changes seen to serial, sw_version, or hw_version.

pybambu/pybambu/models.py

Lines 808 to 816 in 7bfa145

if self.data[index].serial != module['sn']:
received_ams_info = True
self.data[index].serial = module['sn']
if self.data[index].sw_version != module['sw_ver']:
received_ams_info = True
self.data[index].sw_version = module['sw_ver']
if self.data[index].hw_version != module['hw_ver']:
received_ams_info = True
self.data[index].hw_version = module['hw_ver']

This means when tray data is updated from the client the event isn't triggered. I noticed in the HA integration this event has a little different comparison, which I think may resolve this issue.

https://github.com/greghesp/ha-bambulab/blob/ef42cad90b6aa41918189c465fc2f1ad5272f0e1/custom_components/bambu_lab/pybambu/models.py#L878

Any chance we can get a true up and version bump of the latest changes from the HA integration?