Better names for energy related homekit_controller sensors (#65055)

pull/65442/head
Jc2k 2022-01-27 16:08:26 +00:00 committed by Paulus Schoutsen
parent 2ff8f10b9f
commit 05d7fef9f0
7 changed files with 25 additions and 25 deletions

View File

@ -44,21 +44,21 @@ class HomeKitSensorEntityDescription(SensorEntityDescription):
SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_WATT,
name="Real Time Energy",
name="Power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
),
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS,
name="Real Time Current",
name="Current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
),
CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.CONNECTSENSE_ENERGY_AMPS_20,
name="Real Time Current",
name="Current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
@ -72,7 +72,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
),
CharacteristicsTypes.Vendor.EVE_ENERGY_WATT: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.EVE_ENERGY_WATT,
name="Real Time Energy",
name="Power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
@ -100,14 +100,14 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
),
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY,
name="Real Time Energy",
name="Power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
),
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY_2,
name="Real Time Energy",
name="Power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
@ -121,7 +121,7 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
),
CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.VOCOLINC_OUTLET_ENERGY,
name="Real Time Energy",
name="Power",
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,

View File

@ -35,16 +35,16 @@ async def test_connectsense_setup(hass):
devices=[],
entities=[
EntityTestInfo(
entity_id="sensor.inwall_outlet_0394de_real_time_current",
friendly_name="InWall Outlet-0394DE Real Time Current",
entity_id="sensor.inwall_outlet_0394de_current",
friendly_name="InWall Outlet-0394DE Current",
unique_id="homekit-1020301376-aid:1-sid:13-cid:18",
capabilities={"state_class": SensorStateClass.MEASUREMENT},
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state="0.03",
),
EntityTestInfo(
entity_id="sensor.inwall_outlet_0394de_real_time_energy",
friendly_name="InWall Outlet-0394DE Real Time Energy",
entity_id="sensor.inwall_outlet_0394de_power",
friendly_name="InWall Outlet-0394DE Power",
unique_id="homekit-1020301376-aid:1-sid:13-cid:19",
capabilities={"state_class": SensorStateClass.MEASUREMENT},
unit_of_measurement=POWER_WATT,
@ -65,16 +65,16 @@ async def test_connectsense_setup(hass):
state="on",
),
EntityTestInfo(
entity_id="sensor.inwall_outlet_0394de_real_time_current_2",
friendly_name="InWall Outlet-0394DE Real Time Current",
entity_id="sensor.inwall_outlet_0394de_current_2",
friendly_name="InWall Outlet-0394DE Current",
unique_id="homekit-1020301376-aid:1-sid:25-cid:30",
capabilities={"state_class": SensorStateClass.MEASUREMENT},
unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
state="0.05",
),
EntityTestInfo(
entity_id="sensor.inwall_outlet_0394de_real_time_energy_2",
friendly_name="InWall Outlet-0394DE Real Time Energy",
entity_id="sensor.inwall_outlet_0394de_power_2",
friendly_name="InWall Outlet-0394DE Power",
unique_id="homekit-1020301376-aid:1-sid:25-cid:31",
capabilities={"state_class": SensorStateClass.MEASUREMENT},
unit_of_measurement=POWER_WATT,

View File

@ -59,9 +59,9 @@ async def test_eve_degree_setup(hass):
state="0.400000005960464",
),
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",
friendly_name="Eve Energy 50FF Real Time Energy",
friendly_name="Eve Energy 50FF Power",
unit_of_measurement=POWER_WATT,
capabilities={"state_class": SensorStateClass.MEASUREMENT},
state="0",

View File

@ -37,8 +37,8 @@ async def test_koogeek_p1eu_setup(hass):
state="off",
),
EntityTestInfo(
entity_id="sensor.koogeek_p1_a00aa0_real_time_energy",
friendly_name="Koogeek-P1-A00AA0 Real Time Energy",
entity_id="sensor.koogeek_p1_a00aa0_power",
friendly_name="Koogeek-P1-A00AA0 Power",
unique_id="homekit-EUCP03190xxxxx48-aid:1-sid:21-cid:22",
unit_of_measurement=POWER_WATT,
capabilities={"state_class": SensorStateClass.MEASUREMENT},

View File

@ -43,8 +43,8 @@ async def test_koogeek_sw2_setup(hass):
state="off",
),
EntityTestInfo(
entity_id="sensor.koogeek_sw2_187a91_real_time_energy",
friendly_name="Koogeek-SW2-187A91 Real Time Energy",
entity_id="sensor.koogeek_sw2_187a91_power",
friendly_name="Koogeek-SW2-187A91 Power",
unique_id="homekit-CNNT061751001372-aid:1-sid:14-cid:18",
unit_of_measurement=POWER_WATT,
capabilities={"state_class": SensorStateClass.MEASUREMENT},

View File

@ -37,8 +37,8 @@ async def test_vocolinc_vp3_setup(hass):
state="on",
),
EntityTestInfo(
entity_id="sensor.vocolinc_vp3_123456_real_time_energy",
friendly_name="VOCOlinc-VP3-123456 Real Time Energy",
entity_id="sensor.vocolinc_vp3_123456_power",
friendly_name="VOCOlinc-VP3-123456 Power",
unique_id="homekit-EU0121203xxxxx07-aid:1-sid:48-cid:97",
unit_of_measurement=POWER_WATT,
capabilities={"state_class": SensorStateClass.MEASUREMENT},

View File

@ -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.
energy_helper = Helper(
hass,
"sensor.testdevice_real_time_energy",
"sensor.testdevice_power",
helper.pairing,
helper.accessory,
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.
energy_helper = Helper(
hass,
"sensor.testdevice_real_time_energy",
"sensor.testdevice_power",
helper.pairing,
helper.accessory,
helper.config_entry,