mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 00:27:19 +00:00
Add icon translations to Flo (#111542)
This commit is contained in:
parent
359bd625c8
commit
467659cb21
18
homeassistant/components/flo/icons.json
Normal file
18
homeassistant/components/flo/icons.json
Normal file
@ -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 .device import FloDeviceDataUpdateCoordinator
|
||||||
from .entity import FloEntity
|
from .entity import FloEntity
|
||||||
|
|
||||||
WATER_ICON = "mdi:water"
|
|
||||||
GAUGE_ICON = "mdi:gauge"
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@ -60,7 +57,6 @@ async def async_setup_entry(
|
|||||||
class FloDailyUsageSensor(FloEntity, SensorEntity):
|
class FloDailyUsageSensor(FloEntity, SensorEntity):
|
||||||
"""Monitors the daily water usage."""
|
"""Monitors the daily water usage."""
|
||||||
|
|
||||||
_attr_icon = WATER_ICON
|
|
||||||
_attr_native_unit_of_measurement = UnitOfVolume.GALLONS
|
_attr_native_unit_of_measurement = UnitOfVolume.GALLONS
|
||||||
_attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING
|
_attr_state_class: SensorStateClass = SensorStateClass.TOTAL_INCREASING
|
||||||
_attr_device_class = SensorDeviceClass.WATER
|
_attr_device_class = SensorDeviceClass.WATER
|
||||||
@ -98,7 +94,6 @@ class FloSystemModeSensor(FloEntity, SensorEntity):
|
|||||||
class FloCurrentFlowRateSensor(FloEntity, SensorEntity):
|
class FloCurrentFlowRateSensor(FloEntity, SensorEntity):
|
||||||
"""Monitors the current water flow rate."""
|
"""Monitors the current water flow rate."""
|
||||||
|
|
||||||
_attr_icon = GAUGE_ICON
|
|
||||||
_attr_native_unit_of_measurement = UnitOfVolumeFlowRate.GALLONS_PER_MINUTE
|
_attr_native_unit_of_measurement = UnitOfVolumeFlowRate.GALLONS_PER_MINUTE
|
||||||
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
|
_attr_state_class: SensorStateClass = SensorStateClass.MEASUREMENT
|
||||||
_attr_device_class = SensorDeviceClass.VOLUME_FLOW_RATE
|
_attr_device_class = SensorDeviceClass.VOLUME_FLOW_RATE
|
||||||
|
@ -75,13 +75,6 @@ class FloSwitch(FloEntity, SwitchEntity):
|
|||||||
super().__init__("shutoff_valve", device)
|
super().__init__("shutoff_valve", device)
|
||||||
self._attr_is_on = device.last_known_valve_state == "open"
|
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:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Open the valve."""
|
"""Open the valve."""
|
||||||
await self._device.api_client.device.open_valve(self._device.id)
|
await self._device.api_client.device.open_valve(self._device.id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user