From 127e2e278d5cf25a8b180106421ddb4f559d2599 Mon Sep 17 00:00:00 2001 From: Simone Rossetto Date: Wed, 26 Oct 2022 06:58:13 +0200 Subject: [PATCH] Rename sensor for network and gateway data --- custom_components/daikin_residential/const.py | 12 ++++++------ custom_components/daikin_residential/sensor.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/custom_components/daikin_residential/const.py b/custom_components/daikin_residential/const.py index 22bcb87..fb9b2e0 100644 --- a/custom_components/daikin_residential/const.py +++ b/custom_components/daikin_residential/const.py @@ -117,7 +117,7 @@ SENSOR_TYPE_TEMPERATURE = "temperature" SENSOR_TYPE_HUMIDITY = "humidity" -SENSOR_TYPE_NETWORK_DIAGNOSTIC = "network_diagnostic" +SENSOR_TYPE_GATEWAY_DIAGNOSTIC = "gateway_diagnostic" SENSOR_TYPE_POWER = "power" SENSOR_TYPE_ENERGY = "energy" SENSOR_PERIOD_DAILY = "d" @@ -158,32 +158,32 @@ }, ATTR_WIFI_STRENGTH: { CONF_NAME: "WiFi Strength", - CONF_TYPE: SENSOR_TYPE_NETWORK_DIAGNOSTIC, + CONF_TYPE: SENSOR_TYPE_GATEWAY_DIAGNOSTIC, CONF_DEVICE_CLASS: DEVICE_CLASS_SIGNAL_STRENGTH, CONF_UNIT_OF_MEASUREMENT: SIGNAL_STRENGTH_DECIBELS_MILLIWATT, }, ATTR_WIFI_SSID: { CONF_NAME: "WiFi SSID", - CONF_TYPE: SENSOR_TYPE_NETWORK_DIAGNOSTIC, + CONF_TYPE: SENSOR_TYPE_GATEWAY_DIAGNOSTIC, CONF_ICON: "mdi:access-point-network", CONF_DEVICE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, }, ATTR_LOCAL_SSID: { CONF_NAME: "Internal SSID", - CONF_TYPE: SENSOR_TYPE_NETWORK_DIAGNOSTIC, + CONF_TYPE: SENSOR_TYPE_GATEWAY_DIAGNOSTIC, CONF_DEVICE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, }, ATTR_MAC_ADDRESS: { CONF_NAME: "Mac Address", - CONF_TYPE: SENSOR_TYPE_NETWORK_DIAGNOSTIC, + CONF_TYPE: SENSOR_TYPE_GATEWAY_DIAGNOSTIC, CONF_DEVICE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, }, ATTR_SERIAL_NUMBER: { CONF_NAME: "Serial Number", - CONF_TYPE: SENSOR_TYPE_NETWORK_DIAGNOSTIC, + CONF_TYPE: SENSOR_TYPE_GATEWAY_DIAGNOSTIC, CONF_ICON: "mdi:numeric", CONF_DEVICE_CLASS: None, CONF_UNIT_OF_MEASUREMENT: None, diff --git a/custom_components/daikin_residential/sensor.py b/custom_components/daikin_residential/sensor.py index ca92dad..53811d6 100644 --- a/custom_components/daikin_residential/sensor.py +++ b/custom_components/daikin_residential/sensor.py @@ -34,7 +34,7 @@ SENSOR_TYPE_HUMIDITY, SENSOR_TYPE_POWER, SENSOR_TYPE_TEMPERATURE, - SENSOR_TYPE_NETWORK_DIAGNOSTIC, + SENSOR_TYPE_GATEWAY_DIAGNOSTIC, SENSOR_PERIODS, SENSOR_TYPES, ) @@ -103,7 +103,7 @@ def factory(device: Appliance, monitored_state: str, period=""): SENSOR_TYPE_HUMIDITY: DaikinClimateSensor, SENSOR_TYPE_POWER: DaikinEnergySensor, SENSOR_TYPE_ENERGY: DaikinEnergySensor, - SENSOR_TYPE_NETWORK_DIAGNOSTIC: DaikinWiFiSensor, + SENSOR_TYPE_GATEWAY_DIAGNOSTIC: DaikinGatewaySensor, }[SENSOR_TYPES[monitored_state][CONF_TYPE]] return cls(device, monitored_state, period) @@ -201,7 +201,7 @@ def state_class(self): return STATE_CLASS_TOTAL_INCREASING -class DaikinWiFiSensor(DaikinSensor): +class DaikinGatewaySensor(DaikinSensor): """Representation of a WiFi Sensor.""" # set default category for these entities