ShellyForHASS: [BUG] assert self.hass is not None after upgrading to HA 0.112.0

Environment

  • ShellyForHASS release with the issue: 0.1.8
  • Last working ShellyForHASS release (if known): It worked great with ShellyForHASS 0.1.8 and Home assistant 0.111.x
  • Home Assistant Core release with the issue: 0.112.0
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant running on rPi

Describe the bug

Something seems to have changed in HA 0.112.0 regarding the hass object. I get this error below in the Shelly component.

Steps to Reproduce

Upgrade to HA 0.112.0 and start Home Assistant.

Expected behavior

Screenshots

Traceback/Error logs

2020-07-02 13:17:53 ERROR (Thread-261) [pyShelly] Error update device status: 5A3890 SHRGBW2, , Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pyShelly/block.py", line 132, in update_status_information
    dev.update_status_information(status)
  File "/usr/local/lib/python3.7/site-packages/pyShelly/powermeter.py", line 96, in update_status_information
    self._update(self.state, info_values=self.info_values)
  File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 115, in _update
    self.raise_updated()
  File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 125, in raise_updated
    callback(self)
  File "/config/custom_components/shelly/device.py", line 53, in _updated
    self.schedule_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 416, in schedule_update_ha_state
    assert self.hass is not None
AssertionError

Additional context

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 25 (7 by maintainers)

Most upvoted comments

Is this expected to be fixed with the new release with CoAP protocol update and shelly 1.8 firmware?

Nothing related to protocol or firmware. Plugin needs to be updated to follow HA best practice to create entity interfaces.

Simone