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

2023.10.0 - weather sensor setup errors #275

Closed
PeteRager opened this issue Oct 7, 2023 · 0 comments · Fixed by #276
Closed

2023.10.0 - weather sensor setup errors #275

PeteRager opened this issue Oct 7, 2023 · 0 comments · Fixed by #276

Comments

@PeteRager
Copy link
Owner

Describe the bug
During setup of weather sensors on S40 - errors are logged. The weather sensor do work.

To Reproduce
Steps to reproduce the behavior: Start the integration on an S40 system

Expected behavior
Expect no errors to be logged.

Screenshots/Logs
If applicable, add screenshots to help explain your problem.

2023-10-06 18:29:32.446 DEBUG (MainThread) [custom_components.lennoxs30.sensor_wt_env] async_added_to_hass WTEnvSensor myname [Lennox wt env humidity]
2023-10-06 18:29:32.446 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform lennoxs30
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
    state, attr = self._async_generate_attributes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 475, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/lennoxs30/sensor_wt_env.py", line 186, in native_value
    return round(float(value), self._precision)
                 ^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'

Version

  • Home Assistant: 2023.10.1
  • This Integration: 2023.10.0

**Integration Configuration **

  • Cloud or Local Connection: Local
  • Inverter or Sensor Diagnostics Enabled: No

Additional context
Add any other context about the problem here.

@PeteRager PeteRager linked a pull request Oct 7, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant