Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to Home Assistant 2023.06 broke the Slot entities #16

Closed
grahamrjuk opened this issue Jun 7, 2023 · 5 comments
Closed

Upgrading to Home Assistant 2023.06 broke the Slot entities #16

grahamrjuk opened this issue Jun 7, 2023 · 5 comments

Comments

@grahamrjuk
Copy link

After upgrading to Home Assistant 2023.06 the Octopus Intelligent Slot entities (Slot, Slot 1hr, 2hrs, 3hrs and Planned Dispatch are not available. It was all good before the upgrade.

I am using Home Assistant OS, on a Raspberry Pi 4.

Home Assistant 2023.6.0
Supervisor 2023.06.1
Operating System 10.2
Frontend 20230607.0 - latest

I have the following errors in the log:

Logger: py.warnings
Source: runner.py:179
First occurred: 21:48:42 (1 occurrences)
Last logged: 21:48:42

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

and

Logger: homeassistant.components.binary_sensor
Source: custom_components/octopus_intelligent/binary_sensor.py:100
Integration: Binary Sensor (documentation, issues)
First occurred: 21:48:56 (1 occurrences)
Last logged: 21:48:56

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 320, 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 1628, in async_track_utc_time_change
    f"time change listener {hour}:{minute}:{second} {action}",
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1026, in __repr__
    return f"<entity {self.entity_id}={self._stringify_state(self.available)}>"
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 211, 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'

Not sure if it is just a matter of time, and waiting would mean the slot would be updated, or if there is a bug here in the move to Python 3.11.

image

@grahamrjuk
Copy link
Author

Looks like self.is_on() is being called in the super call in OctopusIntelligentSlot.__init__, before self._is_on is defined.

@JasSmiths
Copy link

Same issue here

@megakid megakid closed this as completed in ba7d1f6 Jun 8, 2023
@megakid
Copy link
Owner

megakid commented Jun 8, 2023

Fixed in 1.6.2

Thanks for reporting

@grahamrjuk
Copy link
Author

Thanks for fixing very promptly.

@worz9
Copy link

worz9 commented Jun 9, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants