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

TypeError: unsupported format string passed to NoneType.__format__ #3

Closed
lrswss opened this issue Mar 7, 2021 · 4 comments
Closed

Comments

@lrswss
Copy link

lrswss commented Mar 7, 2021

Just installed your component using HACS on HA 2021.2.3 running in Docker. On startup I get the following stack trace:

2021-03-07 14:23:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component bodymiscale
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/bodymiscale/__init__.py", line 114, in async_setup
    await component.async_add_entities(entities)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 506, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 322, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/config/custom_components/bodymiscale/__init__.py", line 280, in state_attributes
    ATTR_WEIGHT: "{:.2f} kg".format(weight),
TypeError: unsupported format string passed to NoneType.__format__
docker@bpi2:~/homeassistant/config $ docker exec -it 1bba12d5fffb bash
bash-5.0# python3 --version
Python 3.8.7
@dckiller51
Copy link
Owner

Just installed your component using HACS on HA 2021.2.3 running in Docker. On startup I get the following stack trace:

2021-03-07 14:23:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component bodymiscale
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 213, in _async_setup_component
    result = await task
  File "/config/custom_components/bodymiscale/__init__.py", line 114, in async_setup
    await component.async_add_entities(entities)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 315, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 506, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 322, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/config/custom_components/bodymiscale/__init__.py", line 280, in state_attributes
    ATTR_WEIGHT: "{:.2f} kg".format(weight),
TypeError: unsupported format string passed to NoneType.__format__
docker@bpi2:~/homeassistant/config $ docker exec -it 1bba12d5fffb bash
bash-5.0# python3 --version
Python 3.8.7

i cant fix this error but normally you should have your bodyscale.xxxx to create.

@dckiller51
Copy link
Owner

@lrswss can you tell us where are you?

@lrswss
Copy link
Author

lrswss commented Mar 21, 2021

I eventually got everything running. The error is still present upon startup but doesn't seem to have any further impact. Data from the scale is posted to HA as expected.

@dckiller51
Copy link
Owner

J'ai fini par tout faire fonctionner. L'erreur est toujours présente au démarrage mais ne semble pas avoir d'impact supplémentaire. Les données de la balance sont publiées dans HA comme prévu.

Great. I hope that a developer will find a solution. otherwise I will soon share a map.

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

2 participants