gluap / pyduofern-hacs

Repository managing hacs-integration for pyduofern
MIT License
27 stars 8 forks source link

'NoneType' object has no attribute 'add_job' #17

Closed bcutter closed 2 years ago

bcutter commented 2 years ago

This is something I seem to start seeing now that I updatet do HA 2022.12(.6) during start of HA:

Logger: /usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py
Source: helpers/entity.py:677
First occurred: 23:35:01 (2 occurrences)
Last logged: 23:35:02

'NoneType' object has no attribute 'add_job'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py", line 594, in run
    self.process_message(in_data)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py", line 226, in process_message
    self.duofern_parser.parse(message)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern.py", line 202, in parse
    self.update_state(code, "version", ver, "0", channel=channel)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern.py", line 127, in update_state
    self.changes_callback(code, key, value)
  File "/config/custom_components/duofern/__init__.py", line 107, in update_callback
    device.schedule_update_ha_state(True) # Trigger update on the updated entity
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 677, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))  # type: ignore
AttributeError: 'NoneType' object has no attribute 'add_job'
gluap commented 2 years ago

Does this happen on every start? I haven't been able to reproduce with 2022.6.2 thus far, but upgraded only yesterday.

bcutter commented 2 years ago

I monitored it for a while (meanwhile on HA 2022.2.9) and did not see this again. Therefore I'll close this for now, only turning back if I see it again.

Hypfer commented 2 years ago

Same thing happening here with HA 2022.04.6

 Logger: /usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py
Source: helpers/entity.py:693
First occurred: 14:08:58 (3 occurrences)
Last logged: 14:09:00
'NoneType' object has no attribute 'add_job'

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py", line 594, in run
    self.process_message(in_data)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern_stick.py", line 226, in process_message
    self.duofern_parser.parse(message)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern.py", line 202, in parse
    self.update_state(code, "version", ver, "0", channel=channel)
  File "/usr/local/lib/python3.9/site-packages/pyduofern/duofern.py", line 127, in update_state
    self.changes_callback(code, key, value)
  File "/config/custom_components/duofern/__init__.py", line 107, in update_callback
    device.schedule_update_ha_state(True) # Trigger update on the updated entity
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 693, in schedule_update_ha_state
    self.hass.add_job(self.async_update_ha_state(force_refresh))
AttributeError: 'NoneType' object has no attribute 'add_job