Updating Intellifire Naming scheme (#88666)

This commit is contained in:
Jeef 2023-03-03 09:04:27 -05:00 committed by GitHub
parent 9736fe1f99
commit 415190683f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 24 deletions

View File

@ -44,25 +44,25 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...]
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="timer_on", key="timer_on",
name="Timer On", name="Timer on",
icon="mdi:camera-timer", icon="mdi:camera-timer",
value_fn=lambda data: data.timer_on, value_fn=lambda data: data.timer_on,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="pilot_light_on", key="pilot_light_on",
name="Pilot Light On", name="Pilot light on",
icon="mdi:fire-alert", icon="mdi:fire-alert",
value_fn=lambda data: data.pilot_on, value_fn=lambda data: data.pilot_on,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="thermostat_on", key="thermostat_on",
name="Thermostat On", name="Thermostat on",
icon="mdi:home-thermometer-outline", icon="mdi:home-thermometer-outline",
value_fn=lambda data: data.thermostat_on, value_fn=lambda data: data.thermostat_on,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_pilot_flame", key="error_pilot_flame",
name="Pilot Flame Error", name="Pilot flame error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_pilot_flame, value_fn=lambda data: data.error_pilot_flame,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
@ -76,7 +76,7 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...]
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_fan_delay", key="error_fan_delay",
name="Fan Delay Error", name="Fan delay error",
icon="mdi:fan-alert", icon="mdi:fan-alert",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_fan_delay, value_fn=lambda data: data.error_fan_delay,
@ -84,21 +84,21 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...]
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_maintenance", key="error_maintenance",
name="Maintenance Error", name="Maintenance error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_maintenance, value_fn=lambda data: data.error_maintenance,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_disabled", key="error_disabled",
name="Disabled Error", name="Disabled error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_disabled, value_fn=lambda data: data.error_disabled,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_fan", key="error_fan",
name="Fan Error", name="Fan error",
icon="mdi:fan-alert", icon="mdi:fan-alert",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_fan, value_fn=lambda data: data.error_fan,
@ -106,35 +106,35 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...]
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_lights", key="error_lights",
name="Lights Error", name="Lights error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_lights, value_fn=lambda data: data.error_lights,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_accessory", key="error_accessory",
name="Accessory Error", name="Accessory error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_accessory, value_fn=lambda data: data.error_accessory,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_soft_lock_out", key="error_soft_lock_out",
name="Soft Lock Out Error", name="Soft lock out error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_soft_lock_out, value_fn=lambda data: data.error_soft_lock_out,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_ecm_offline", key="error_ecm_offline",
name="ECM Offline Error", name="ECM offline error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_ecm_offline, value_fn=lambda data: data.error_ecm_offline,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
IntellifireBinarySensorEntityDescription( IntellifireBinarySensorEntityDescription(
key="error_offline", key="error_offline",
name="Offline Error", name="Offline error",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.error_offline, value_fn=lambda data: data.error_offline,
device_class=BinarySensorDeviceClass.PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,

View File

@ -67,7 +67,7 @@ class IntellifireDataUpdateCoordinator(DataUpdateCoordinator[IntellifirePollData
return DeviceInfo( return DeviceInfo(
manufacturer="Hearth and Home", manufacturer="Hearth and Home",
model="IFT-WFM", model="IFT-WFM",
name="IntelliFire Fireplace", name="IntelliFire",
identifiers={("IntelliFire", f"{self.read_api.data.serial}]")}, identifiers={("IntelliFire", f"{self.read_api.data.serial}]")},
sw_version=self.read_api.data.fw_ver_str, sw_version=self.read_api.data.fw_ver_str,
configuration_url=f"http://{self._api.fireplace_ip}/poll", configuration_url=f"http://{self._api.fireplace_ip}/poll",

View File

@ -21,7 +21,8 @@ class IntellifireEntity(CoordinatorEntity[IntellifireDataUpdateCoordinator]):
super().__init__(coordinator=coordinator) super().__init__(coordinator=coordinator)
self.entity_description = description self.entity_description = description
# Set the Display name the User will see # Set the Display name the User will see
self._attr_name = f"Fireplace {description.name}" self._attr_name = description.name
self._attr_unique_id = f"{description.key}_{coordinator.read_api.data.serial}" self._attr_unique_id = f"{description.key}_{coordinator.read_api.data.serial}"
self._attr_has_entity_name = True
# Configure the Device Info # Configure the Device Info
self._attr_device_info = self.coordinator.device_info self._attr_device_info = self.coordinator.device_info

View File

@ -46,7 +46,6 @@ INTELLIFIRE_FANS: tuple[IntellifireFanEntityDescription, ...] = (
IntellifireFanEntityDescription( IntellifireFanEntityDescription(
key="fan", key="fan",
name="Fan", name="Fan",
has_entity_name=True,
set_fn=lambda control_api, speed: control_api.set_fan_speed(speed=speed), set_fn=lambda control_api, speed: control_api.set_fan_speed(speed=speed),
value_fn=lambda data: data.fanspeed, value_fn=lambda data: data.fanspeed,
speed_range=(1, 4), speed_range=(1, 4),

View File

@ -17,7 +17,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN from .const import DOMAIN, LOGGER
from .coordinator import IntellifireDataUpdateCoordinator from .coordinator import IntellifireDataUpdateCoordinator
from .entity import IntellifireEntity from .entity import IntellifireEntity
@ -41,7 +41,6 @@ INTELLIFIRE_LIGHTS: tuple[IntellifireLightEntityDescription, ...] = (
IntellifireLightEntityDescription( IntellifireLightEntityDescription(
key="lights", key="lights",
name="Lights", name="Lights",
has_entity_name=True,
set_fn=lambda control_api, level: control_api.set_lights(level=level), set_fn=lambda control_api, level: control_api.set_lights(level=level),
value_fn=lambda data: data.light_level, value_fn=lambda data: data.light_level,
), ),
@ -95,3 +94,4 @@ async def async_setup_entry(
for description in INTELLIFIRE_LIGHTS for description in INTELLIFIRE_LIGHTS
) )
return return
LOGGER.debug("Disabling Lights - IntelliFire device does not appear to have one")

View File

@ -26,8 +26,8 @@ async def async_setup_entry(
coordinator: IntellifireDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] coordinator: IntellifireDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
description = NumberEntityDescription( description = NumberEntityDescription(
key="flame_control", key="flame_height",
name="Flame control", name="Flame height",
icon="mdi:arrow-expand-vertical", icon="mdi:arrow-expand-vertical",
) )

View File

@ -57,7 +57,7 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = (
IntellifireSensorEntityDescription( IntellifireSensorEntityDescription(
key="flame_height", key="flame_height",
icon="mdi:fire-circle", icon="mdi:fire-circle",
name="Flame Height", name="Flame height",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
# UI uses 1-5 for flame height, backing lib uses 0-4 # UI uses 1-5 for flame height, backing lib uses 0-4
value_fn=lambda data: (data.flameheight + 1), value_fn=lambda data: (data.flameheight + 1),
@ -72,7 +72,7 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = (
), ),
IntellifireSensorEntityDescription( IntellifireSensorEntityDescription(
key="target_temp", key="target_temp",
name="Target Temperature", name="Target temperature",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS, native_unit_of_measurement=UnitOfTemperature.CELSIUS,
@ -116,7 +116,7 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = (
), ),
IntellifireSensorEntityDescription( IntellifireSensorEntityDescription(
key="ecm_latency", key="ecm_latency",
name="ECM Latency", name="ECM latency",
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: data.ecm_latency, value_fn=lambda data: data.ecm_latency,
entity_registry_enabled_default=False, entity_registry_enabled_default=False,

View File

@ -44,7 +44,7 @@ INTELLIFIRE_SWITCHES: tuple[IntellifireSwitchEntityDescription, ...] = (
), ),
IntellifireSwitchEntityDescription( IntellifireSwitchEntityDescription(
key="pilot", key="pilot",
name="Pilot Light", name="Pilot light",
icon="mdi:fire-alert", icon="mdi:fire-alert",
on_fn=lambda control_api: control_api.pilot_on(), on_fn=lambda control_api: control_api.pilot_on(),
off_fn=lambda control_api: control_api.pilot_off(), off_fn=lambda control_api: control_api.pilot_off(),