joleys / niko-home-control-II

Home Assistant Custom Integration for Niko Home Control II
MIT License
74 stars 21 forks source link

Fix for #107 #109

Closed ostracon closed 9 months ago

ostracon commented 9 months ago

Based on feedback/hints in #107 and some head-bashing, generated this PR, with which the full functionality of the Daikin AC units via Niko is avaiable in HA.

ostracon commented 9 months ago

Thanks for the feedback! I think I've addressed all the comments, but happy to take another look :)

ostracon commented 9 months ago

Just to note on the .exception vs .error - it seems the error I previously reported is related to the energy component; disabling the device as recommended in the README removes the error, but for reference, with .exception, a fuller trace is:

2024-01-11 09:37:19.380 ERROR (Thread-5 (_thread_main)) [custom_components.nhc2.nhccoco.coco] 'NoneType' object has no attribute 'loop'
Traceback (most recent call last):
  File "/config/custom_components/nhc2/nhccoco/coco.py", line 150, in _on_message
    self._device_instances[device[MQTT_DATA_PARAMS_DEVICES_UUID]].on_change(topic, device)
  File "/config/custom_components/nhc2/nhccoco/devices/generic_energyhome.py", line 76, in on_change
    callback()
  File "/config/custom_components/nhc2/entities/generic_energyhome_electrical_power_to_grid.py", line 53, in on_change
    self.schedule_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1157, in schedule_update_ha_state
    self.hass.loop.call_soon_threadsafe(self.async_write_ha_state)
    ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'loop'`
ostracon commented 9 months ago

Addressed the outstanding review comments in 7b8c47c

ostracon commented 9 months ago

Oops, apologies - f0e0398 has those removed

ostracon commented 9 months ago

Thanks for your patience!