mirror of
https://github.com/home-assistant/core.git
synced 2025-11-16 06:20:07 +00:00
Add icon translations to Homekit Controller (#111720)
* Add icon translations to Homekit Controller * Add icon translations to Homekit Controller
This commit is contained in:
committed by
GitHub
parent
b6d56d38ba
commit
15cd9c011e
@@ -70,7 +70,6 @@ async def async_setup_entry(
|
||||
class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity):
|
||||
"""Representation of a Homekit Alarm Control Panel."""
|
||||
|
||||
_attr_icon = "mdi:security"
|
||||
_attr_supported_features = (
|
||||
AlarmControlPanelEntityFeature.ARM_HOME
|
||||
| AlarmControlPanelEntityFeature.ARM_AWAY
|
||||
|
||||
@@ -41,7 +41,7 @@ BUTTON_ENTITIES: dict[str, HomeKitButtonEntityDescription] = {
|
||||
CharacteristicsTypes.VENDOR_HAA_SETUP: HomeKitButtonEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_HAA_SETUP,
|
||||
name="Setup",
|
||||
icon="mdi:cog",
|
||||
translation_key="setup",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
write_value="#HAA@trcmd",
|
||||
),
|
||||
|
||||
53
homeassistant/components/homekit_controller/icons.json
Normal file
53
homeassistant/components/homekit_controller/icons.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"entity": {
|
||||
"button": {
|
||||
"setup": {
|
||||
"default": "mdi:cog"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"spray_quantity": {
|
||||
"default": "mdi:water"
|
||||
},
|
||||
"elevation": {
|
||||
"default": "mdi:elevation-rise"
|
||||
},
|
||||
"volume": {
|
||||
"default": "mdi:volume-high"
|
||||
},
|
||||
"duration": {
|
||||
"default": "mdi:timer"
|
||||
},
|
||||
"sensitivity": {
|
||||
"default": "mdi:knob"
|
||||
}
|
||||
},
|
||||
"select": {
|
||||
"temperature_display_units": {
|
||||
"default": "mdi:thermometer"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"valve_position": {
|
||||
"default": "mdi:pipe-valve"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"pairing_mode": {
|
||||
"default": "mdi:lock-open"
|
||||
},
|
||||
"lock_physical_controls": {
|
||||
"default": "mdi:lock-open"
|
||||
},
|
||||
"mute": {
|
||||
"default": "mdi:volume-mute"
|
||||
},
|
||||
"sleep_mode": {
|
||||
"default": "mdi:power-sleep"
|
||||
},
|
||||
"valve": {
|
||||
"default": "mdi:water"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,37 +28,37 @@ NUMBER_ENTITIES: dict[str, NumberEntityDescription] = {
|
||||
CharacteristicsTypes.VENDOR_VOCOLINC_HUMIDIFIER_SPRAY_LEVEL: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_VOCOLINC_HUMIDIFIER_SPRAY_LEVEL,
|
||||
name="Spray Quantity",
|
||||
icon="mdi:water",
|
||||
translation_key="spray_quantity",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_EVE_DEGREE_ELEVATION: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_EVE_DEGREE_ELEVATION,
|
||||
name="Elevation",
|
||||
icon="mdi:elevation-rise",
|
||||
translation_key="elevation",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_AQARA_GATEWAY_VOLUME: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_AQARA_GATEWAY_VOLUME,
|
||||
name="Volume",
|
||||
icon="mdi:volume-high",
|
||||
translation_key="volume",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_AQARA_E1_GATEWAY_VOLUME: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_AQARA_E1_GATEWAY_VOLUME,
|
||||
name="Volume",
|
||||
icon="mdi:volume-high",
|
||||
translation_key="volume",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_EVE_MOTION_DURATION: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_EVE_MOTION_DURATION,
|
||||
name="Duration",
|
||||
icon="mdi:timer",
|
||||
translation_key="duration",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_EVE_MOTION_SENSITIVITY: NumberEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_EVE_MOTION_SENSITIVITY,
|
||||
name="Sensitivity",
|
||||
icon="mdi:knob",
|
||||
translation_key="sensitivity",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ SELECT_ENTITIES: dict[str, HomeKitSelectEntityDescription] = {
|
||||
key="temperature_display_units",
|
||||
translation_key="temperature_display_units",
|
||||
name="Temperature Display Units",
|
||||
icon="mdi:thermometer",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
choices={
|
||||
"celsius": TemperatureDisplayUnits.CELSIUS,
|
||||
|
||||
@@ -358,7 +358,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||
CharacteristicsTypes.VENDOR_EVE_THERMO_VALVE_POSITION: HomeKitSensorEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_EVE_THERMO_VALVE_POSITION,
|
||||
name="Valve position",
|
||||
icon="mdi:pipe-valve",
|
||||
translation_key="valve_position",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
@@ -520,7 +520,7 @@ class HomeKitBatterySensor(HomeKitSensor):
|
||||
|
||||
@property
|
||||
def is_charging(self) -> bool:
|
||||
"""Return true if currently charing."""
|
||||
"""Return true if currently charging."""
|
||||
# 0 = not charging
|
||||
# 1 = charging
|
||||
# 2 = not chargeable
|
||||
|
||||
@@ -42,31 +42,31 @@ SWITCH_ENTITIES: dict[str, DeclarativeSwitchEntityDescription] = {
|
||||
CharacteristicsTypes.VENDOR_AQARA_PAIRING_MODE: DeclarativeSwitchEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_AQARA_PAIRING_MODE,
|
||||
name="Pairing Mode",
|
||||
icon="mdi:lock-open",
|
||||
translation_key="pairing_mode",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_AQARA_E1_PAIRING_MODE: DeclarativeSwitchEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_AQARA_E1_PAIRING_MODE,
|
||||
name="Pairing Mode",
|
||||
icon="mdi:lock-open",
|
||||
translation_key="pairing_mode",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.LOCK_PHYSICAL_CONTROLS: DeclarativeSwitchEntityDescription(
|
||||
key=CharacteristicsTypes.LOCK_PHYSICAL_CONTROLS,
|
||||
name="Lock Physical Controls",
|
||||
icon="mdi:lock-open",
|
||||
translation_key="lock_physical_controls",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.MUTE: DeclarativeSwitchEntityDescription(
|
||||
key=CharacteristicsTypes.MUTE,
|
||||
name="Mute",
|
||||
icon="mdi:volume-mute",
|
||||
translation_key="mute",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
CharacteristicsTypes.VENDOR_AIRVERSA_SLEEP_MODE: DeclarativeSwitchEntityDescription(
|
||||
key=CharacteristicsTypes.VENDOR_AIRVERSA_SLEEP_MODE,
|
||||
name="Sleep Mode",
|
||||
icon="mdi:power-sleep",
|
||||
translation_key="sleep_mode",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
}
|
||||
@@ -104,6 +104,8 @@ class HomeKitSwitch(HomeKitEntity, SwitchEntity):
|
||||
class HomeKitValve(HomeKitEntity, SwitchEntity):
|
||||
"""Represents a valve in an irrigation system."""
|
||||
|
||||
_attr_translation_key = "valve"
|
||||
|
||||
def get_characteristic_types(self) -> list[str]:
|
||||
"""Define the homekit characteristics the entity cares about."""
|
||||
return [
|
||||
@@ -121,11 +123,6 @@ class HomeKitValve(HomeKitEntity, SwitchEntity):
|
||||
"""Turn the specified valve off."""
|
||||
await self.async_put_characteristics({CharacteristicsTypes.ACTIVE: False})
|
||||
|
||||
@property
|
||||
def icon(self) -> str:
|
||||
"""Return the icon."""
|
||||
return "mdi:water"
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""Return true if device is on."""
|
||||
|
||||
Reference in New Issue
Block a user