Skip to content

Commit

Permalink
Rename sensor for network and gateway data
Browse files Browse the repository at this point in the history
  • Loading branch information
droscy authored and rospogrigio committed Oct 28, 2022
1 parent 35264d5 commit 127e2e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions custom_components/daikin_residential/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions custom_components/daikin_residential/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 127e2e2

Please sign in to comment.