megakid / ha_octopus_intelligent

Apache License 2.0
86 stars 10 forks source link

Binary sensor startup failing #25

Closed GSV3MiaC closed 9 months ago

GSV3MiaC commented 9 months ago

I just restarted HA (new version) and the IO binary sensors are not working, error log says:

Error while setting up octopus_intelligent platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/octopus_intelligent/binary_sensor.py", line 19, in async_setup_entry OctopusIntelligentSlot( File "/config/custom_components/octopus_intelligent/binary_sensor.py", line 59, in init self._timer = async_track_utc_time_change( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1687, in async_track_utc_time_change f"time change listener {hour}:{minute}:{second} {action}", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1245, in repr return f"<entity {self.entity_id}={self._stringify_state(self.available)}>" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py", line 218, in state if (is_on := self.is_on) is None: ^^^^^^^^^^ File "/config/custom_components/octopus_intelligent/binary_sensor.py", line 100, in is_on return self._is_on ^^^^^^^^^^^ AttributeError: 'OctopusIntelligentSlot' object has no attribute '_is_on'

May be related to previous error:

Logger: py.warnings Source: runner.py:186 First occurred: 9:15:17 AM (1 occurrences) Last logged: 9:15:17 AM

/usr/local/lib/python3.11/asyncio/base_events.py:1907: RuntimeWarning: coroutine 'OctopusIntelligentSystem.start' was never awaited handle = self._ready.popleft()

GSV3MiaC commented 9 months ago

Ok, I think I just need to update my version to latest,