mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
Support disconnected Powerwall configuration (#67325)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
d077c3b8d1
commit
508ed257d4
@ -110,6 +110,15 @@ class PowerWallChargingStatusSensor(PowerWallEntity, BinarySensorEntity):
|
||||
_attr_name = "Powerwall Charging"
|
||||
_attr_device_class = BinarySensorDeviceClass.BATTERY_CHARGING
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Powerwall is available."""
|
||||
# Return False if no battery is installed
|
||||
return (
|
||||
super().available
|
||||
and self.data.meters.get_meter(MeterType.BATTERY) is not None
|
||||
)
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Device Uniqueid."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user