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

Exception in Home Assistant #79

Closed
Redferne opened this issue Jan 18, 2018 · 1 comment
Closed

Exception in Home Assistant #79

Redferne opened this issue Jan 18, 2018 · 1 comment
Assignees
Labels

Comments

@Redferne
Copy link

Hi,

Some of my MiFloras are slow to respond or out of range. Getting many of these in the log:

2018-01-18 22:39:24 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.stripe_conductivity fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 199, in async_update_ha_state
    yield from self.async_device_update()
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 306, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/sensor/miflora.py", line 135, in update
    data = self.poller.parameter_value(self.parameter)
  File "/srv/homeassistant/lib/python3.6/site-packages/miflora/miflora_poller.py", line 128, in parameter_value
    self.fill_cache()
  File "/srv/homeassistant/lib/python3.6/site-packages/miflora/miflora_poller.py", line 60, in fill_cache
    firmware_version = self.firmware_version()
  File "/srv/homeassistant/lib/python3.6/site-packages/miflora/miflora_poller.py", line 102, in firmware_version
    _HANDLE_READ_VERSION_BATTERY, self._format_bytes(res))
  File "/srv/homeassistant/lib/python3.6/site-packages/miflora/miflora_poller.py", line 170, in _format_bytes
    return ' '.join([format(c, "02x") for c in raw_data]).upper()
TypeError: 'NoneType' object is not iterable

Are there some way of handling these?

@ChristianKuehnel
Copy link
Collaborator

Hi @Redferne,

thank you for the hint. I'm not checking for None as input data. This is fixed in #80

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

No branches or pull requests

2 participants