Teslemetry / hass-teslemetry

Teslemetry integration from Home Assistant through HACS
https://teslemetry.com
MIT License
13 stars 6 forks source link

1.7.4: ChargerPhases > 1 check failing #43

Closed purcell-lab closed 6 months ago

purcell-lab commented 6 months ago

Checklist

Describe the issue

Not yet seeing the stream entities appear in Home Assistant

Looks like the ChargerPhases > 1 check is failing.

Debug logs

2024-03-15 17:23:55.878 DEBUG (MainThread) [teslemetry_stream] event {"data": {"Soc": "80.732"}, "createdAt": "2024-03-15T07:22:44.429441182Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487364429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"ChargeCurrentRequest": "16"}, "createdAt": "2024-03-15T07:22:54.429487543Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487374429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"Soc": "80.913"}, "createdAt": "2024-03-15T07:23:04.429417483Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487384429}
2024-03-15 17:23:55.879 DEBUG (MainThread) [teslemetry_stream] event {"data": {"ChargerPhases": "2", "ChargeAmps": "16", "ChargeLimitSoc": "100"}, "createdAt": "2024-03-15T07:23:24.429636642Z", "vin": "5YJ3F7EC5LF698201", "timestamp": 1710487404429}
2024-03-15 17:23:55.879 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/teslemetry_stream/__init__.py", line 193, in listen
    listener(event)
  File "/config/custom_components/teslemetry/entity.py", line 179, in _handle_stream_update
    self._async_value_from_stream(value)
  File "/config/custom_components/teslemetry/binary_sensor.py", line 270, in _async_value_from_stream
    self._attr_is_on = self.entity_description.is_on(value)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/teslemetry/binary_sensor.py", line 64, in <lambda>
    is_on=lambda x: x > 1,
                    ^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'
Bre77 commented 6 months ago

This has been fixed for the next release.