mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix wall connector states in Teslemetry (#144855)
* Fix wall connector * Update snapshot
This commit is contained in:
parent
9aa2664188
commit
d2a692393f
@ -9,6 +9,7 @@ from tesla_fleet_api.teslemetry import EnergySite, Vehicle
|
||||
from homeassistant.exceptions import ServiceValidationError
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.typing import StateType
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from .const import DOMAIN
|
||||
@ -228,7 +229,7 @@ class TeslemetryWallConnectorEntity(TeslemetryPollingEntity):
|
||||
super().__init__(data.live_coordinator, key)
|
||||
|
||||
@property
|
||||
def _value(self) -> int:
|
||||
def _value(self) -> StateType:
|
||||
"""Return a specific wall connector value from coordinator data."""
|
||||
return (
|
||||
self.coordinator.data.get("wall_connectors", {})
|
||||
|
@ -1785,8 +1785,7 @@ class TeslemetryWallConnectorSensorEntity(TeslemetryWallConnectorEntity, SensorE
|
||||
|
||||
def _async_update_attrs(self) -> None:
|
||||
"""Update the attributes of the sensor."""
|
||||
if self.exists:
|
||||
self._attr_native_value = self.entity_description.value_fn(self._value)
|
||||
self._attr_native_value = self.entity_description.value_fn(self._value)
|
||||
|
||||
|
||||
class TeslemetryEnergyInfoSensorEntity(TeslemetryEnergyInfoEntity, SensorEntity):
|
||||
|
@ -4978,7 +4978,7 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
'state': 'disconnected',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.wall_connector_vehicle-statealt]
|
||||
@ -4991,7 +4991,7 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
'state': 'disconnected',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.wall_connector_vehicle_2-entry]
|
||||
@ -5038,7 +5038,7 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
'state': 'disconnected',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.wall_connector_vehicle_2-statealt]
|
||||
@ -5051,7 +5051,7 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
'state': 'disconnected',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors_streaming[sensor.test_battery_level-state]
|
||||
|
Loading…
x
Reference in New Issue
Block a user