Add icon translations to Flo (#111542)
parent
359bd625c8
commit
467659cb21
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"entity": {
|
||||
"switch": {
|
||||
"shutoff_valve": {
|
||||
"default": "mdi:valve-closed",
|
||||
"state": {
|
||||
"on": "mdi:valve-open"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"set_sleep_mode": "mdi:sleep",
|
||||
"set_away_mode": "mdi:home-off",
|
||||
"set_home_mode": "mdi:home",
|
||||
"run_health_test": "mdi:heart-flash"
|
||||
}
|
||||
}
|
|
@ -21,9 +21,6 @@ from .const import DOMAIN as FLO_DOMAIN
|
|||
from .device import FloDeviceDataUpdateCoordinator
|
||||
from .entity import FloEntity
|
||||
|
||||
WATER_ICON = "mdi:water"
|
||||
GAUGE_ICON = "mdi:gauge"
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
|
@ -60,7 +57,6 @@ async def async_setup_entry(
|
|||
class FloDailyUsageSensor(FloEntity, SensorEntity):
|
||||
"""Monitors the daily water usage."""
|
||||
|
||||
_attr_icon = WATER_ICON
|
||||
_attr_native_unit_of_measurement = UnitOfVolume.GALLONS
|
||||
_attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING
|
||||
_attr_device_class = SensorDeviceClass.WATER
|
||||
|
@ -98,7 +94,6 @@ class FloSystemModeSensor(FloEntity, SensorEntity):
|
|||
class FloCurrentFlowRateSensor(FloEntity, SensorEntity):
|
||||
"""Monitors the current water flow rate."""
|
||||
|
||||
_attr_icon = GAUGE_ICON
|
||||
_attr_native_unit_of_measurement = UnitOfVolumeFlowRate.GALLONS_PER_MINUTE
|
||||
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
|
||||
_attr_device_class = SensorDeviceClass.VOLUME_FLOW_RATE
|
||||
|
|
|
@ -75,13 +75,6 @@ class FloSwitch(FloEntity, SwitchEntity):
|
|||
super().__init__("shutoff_valve", device)
|
||||
self._attr_is_on = device.last_known_valve_state == "open"
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Return the icon to use for the valve."""
|
||||
if self.is_on:
|
||||
return "mdi:valve-open"
|
||||
return "mdi:valve-closed"
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
"""Open the valve."""
|
||||
await self._device.api_client.device.open_valve(self._device.id)
|
||||
|
|
Loading…
Reference in New Issue