Better names for energy related homekit_controller sensors (#65055)
parent
2ff8f10b9f
commit
05d7fef9f0
|
@ -44,21 +44,21 @@ class HomeKitSensorEntityDescription(SensorEntityDescription):
|
||||||
SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT,
|
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT,
|
||||||
name="Real Time Energy",
|
name="Power",
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS,
|
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS,
|
||||||
name="Real Time Current",
|
name="Current",
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20,
|
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20,
|
||||||
name="Real Time Current",
|
name="Current",
|
||||||
device_class=SensorDeviceClass.CURRENT,
|
device_class=SensorDeviceClass.CURRENT,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||||
|
@ -72,7 +72,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.EVE_ENERGY_WATT,
|
key=CharacteristicsTypes.Vendor.EVE_ENERGY_WATT,
|
||||||
name="Real Time Energy",
|
name="Power",
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
|
@ -100,14 +100,14 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY,
|
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY,
|
||||||
name="Real Time Energy",
|
name="Power",
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2,
|
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2,
|
||||||
name="Real Time Energy",
|
name="Power",
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
|
@ -121,7 +121,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
|
||||||
),
|
),
|
||||||
CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY: HomeKitSensorEntityDescription(
|
CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY: HomeKitSensorEntityDescription(
|
||||||
key=CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY,
|
key=CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY,
|
||||||
name="Real Time Energy",
|
name="Power",
|
||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
native_unit_of_measurement=POWER_WATT,
|
native_unit_of_measurement=POWER_WATT,
|
||||||
|
|
|
@ -35,16 +35,16 @@ async def test_connectsense_setup(hass):
|
||||||
devices=[],
|
devices=[],
|
||||||
entities=[
|
entities=[
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.inwall_outlet_0394de_real_time_current",
|
entity_id="sensor.inwall_outlet_0394de_current",
|
||||||
friendly_name="InWall Outlet-0394DE Real Time Current",
|
friendly_name="InWall Outlet-0394DE Current",
|
||||||
unique_id="homekit-1020301376-aid:1-sid:13-cid:18",
|
unique_id="homekit-1020301376-aid:1-sid:13-cid:18",
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||||
state="0.03",
|
state="0.03",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.inwall_outlet_0394de_real_time_energy",
|
entity_id="sensor.inwall_outlet_0394de_power",
|
||||||
friendly_name="InWall Outlet-0394DE Real Time Energy",
|
friendly_name="InWall Outlet-0394DE Power",
|
||||||
unique_id="homekit-1020301376-aid:1-sid:13-cid:19",
|
unique_id="homekit-1020301376-aid:1-sid:13-cid:19",
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
|
@ -65,16 +65,16 @@ async def test_connectsense_setup(hass):
|
||||||
state="on",
|
state="on",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.inwall_outlet_0394de_real_time_current_2",
|
entity_id="sensor.inwall_outlet_0394de_current_2",
|
||||||
friendly_name="InWall Outlet-0394DE Real Time Current",
|
friendly_name="InWall Outlet-0394DE Current",
|
||||||
unique_id="homekit-1020301376-aid:1-sid:25-cid:30",
|
unique_id="homekit-1020301376-aid:1-sid:25-cid:30",
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
|
||||||
state="0.05",
|
state="0.05",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.inwall_outlet_0394de_real_time_energy_2",
|
entity_id="sensor.inwall_outlet_0394de_power_2",
|
||||||
friendly_name="InWall Outlet-0394DE Real Time Energy",
|
friendly_name="InWall Outlet-0394DE Power",
|
||||||
unique_id="homekit-1020301376-aid:1-sid:25-cid:31",
|
unique_id="homekit-1020301376-aid:1-sid:25-cid:31",
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
|
|
|
@ -59,9 +59,9 @@ async def test_eve_degree_setup(hass):
|
||||||
state="0.400000005960464",
|
state="0.400000005960464",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.eve_energy_50ff_real_time_energy",
|
entity_id="sensor.eve_energy_50ff_power",
|
||||||
unique_id="homekit-AA00A0A00000-aid:1-sid:28-cid:34",
|
unique_id="homekit-AA00A0A00000-aid:1-sid:28-cid:34",
|
||||||
friendly_name="Eve Energy 50FF Real Time Energy",
|
friendly_name="Eve Energy 50FF Power",
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
state="0",
|
state="0",
|
||||||
|
|
|
@ -37,8 +37,8 @@ async def test_koogeek_p1eu_setup(hass):
|
||||||
state="off",
|
state="off",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.koogeek_p1_a00aa0_real_time_energy",
|
entity_id="sensor.koogeek_p1_a00aa0_power",
|
||||||
friendly_name="Koogeek-P1-A00AA0 Real Time Energy",
|
friendly_name="Koogeek-P1-A00AA0 Power",
|
||||||
unique_id="homekit-EUCP03190xxxxx48-aid:1-sid:21-cid:22",
|
unique_id="homekit-EUCP03190xxxxx48-aid:1-sid:21-cid:22",
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
|
|
|
@ -43,8 +43,8 @@ async def test_koogeek_sw2_setup(hass):
|
||||||
state="off",
|
state="off",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.koogeek_sw2_187a91_real_time_energy",
|
entity_id="sensor.koogeek_sw2_187a91_power",
|
||||||
friendly_name="Koogeek-SW2-187A91 Real Time Energy",
|
friendly_name="Koogeek-SW2-187A91 Power",
|
||||||
unique_id="homekit-CNNT061751001372-aid:1-sid:14-cid:18",
|
unique_id="homekit-CNNT061751001372-aid:1-sid:14-cid:18",
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
|
|
|
@ -37,8 +37,8 @@ async def test_vocolinc_vp3_setup(hass):
|
||||||
state="on",
|
state="on",
|
||||||
),
|
),
|
||||||
EntityTestInfo(
|
EntityTestInfo(
|
||||||
entity_id="sensor.vocolinc_vp3_123456_real_time_energy",
|
entity_id="sensor.vocolinc_vp3_123456_power",
|
||||||
friendly_name="VOCOlinc-VP3-123456 Real Time Energy",
|
friendly_name="VOCOlinc-VP3-123456 Power",
|
||||||
unique_id="homekit-EU0121203xxxxx07-aid:1-sid:48-cid:97",
|
unique_id="homekit-EU0121203xxxxx07-aid:1-sid:48-cid:97",
|
||||||
unit_of_measurement=POWER_WATT,
|
unit_of_measurement=POWER_WATT,
|
||||||
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
capabilities={"state_class": SensorStateClass.MEASUREMENT},
|
||||||
|
|
|
@ -218,7 +218,7 @@ async def test_switch_with_sensor(hass, utcnow):
|
||||||
# Helper will be for the primary entity, which is the outlet. Make a helper for the sensor.
|
# Helper will be for the primary entity, which is the outlet. Make a helper for the sensor.
|
||||||
energy_helper = Helper(
|
energy_helper = Helper(
|
||||||
hass,
|
hass,
|
||||||
"sensor.testdevice_real_time_energy",
|
"sensor.testdevice_power",
|
||||||
helper.pairing,
|
helper.pairing,
|
||||||
helper.accessory,
|
helper.accessory,
|
||||||
helper.config_entry,
|
helper.config_entry,
|
||||||
|
@ -248,7 +248,7 @@ async def test_sensor_unavailable(hass, utcnow):
|
||||||
# Helper will be for the primary entity, which is the outlet. Make a helper for the sensor.
|
# Helper will be for the primary entity, which is the outlet. Make a helper for the sensor.
|
||||||
energy_helper = Helper(
|
energy_helper = Helper(
|
||||||
hass,
|
hass,
|
||||||
"sensor.testdevice_real_time_energy",
|
"sensor.testdevice_power",
|
||||||
helper.pairing,
|
helper.pairing,
|
||||||
helper.accessory,
|
helper.accessory,
|
||||||
helper.config_entry,
|
helper.config_entry,
|
||||||
|
|
Loading…
Reference in New Issue