bodymiscale: TypeError: '>' not supported between instances of 'NoneType' and 'int'
Since the Update to HomeAssistant core-2021.7.0 and core-2021.7.1 i get the following error with my sensors for the bodyscale:
Logger: homeassistant.helpers.event
Source: custom_components/bodymiscale/body_metrics.py:20
Integration: Bodymiscale (documentation)
First occurred: 16:00:38 (2 occurrences)
Last logged: 16:00:38
Error while processing state change for sensor.xiaomiscale1
Error while processing state change for sensor.xiaomiscale2
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 272, in _async_state_change_dispatcher
hass.async_run_hass_job(job, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 432, in async_run_hass_job
hassjob.target(*args)
File "/config/custom_components/bodymiscale/__init__.py", line 168, in _state_changed_event
self.state_changed(event.data.get("entity_id"), event.data.get("new_state"))
File "/config/custom_components/bodymiscale/__init__.py", line 191, in state_changed
self._update_state()
File "/config/custom_components/bodymiscale/__init__.py", line 218, in _update_state
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 455, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/config/custom_components/bodymiscale/__init__.py", line 301, in state_attributes
lib = body_metrics.bodyMetrics(weight, height, age, gender, impedance)
File "/config/custom_components/bodymiscale/body_metrics.py", line 20, in __init__
elif impedance > 3000:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (11 by maintainers)
The issue is gone with the newest version of Home Assistant.