Add Eagle 200 name back (#55477)

* Add Eagle 200 name back

* add comment

* update tests
pull/55493/head
Paulus Schoutsen 2021-08-30 23:45:35 -07:00 committed by GitHub
parent 13b001cd9b
commit d277e0fb03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -38,21 +38,22 @@ _LOGGER = logging.getLogger(__name__)
SENSORS = (
SensorEntityDescription(
key="zigbee:InstantaneousDemand",
name="Meter Power Demand",
# We can drop the "Eagle-200" part of the name in HA 2021.12
name="Eagle-200 Meter Power Demand",
native_unit_of_measurement=POWER_KILO_WATT,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
SensorEntityDescription(
key="zigbee:CurrentSummationDelivered",
name="Total Meter Energy Delivered",
name="Eagle-200 Total Meter Energy Delivered",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
device_class=DEVICE_CLASS_ENERGY,
state_class=STATE_CLASS_TOTAL_INCREASING,
),
SensorEntityDescription(
key="zigbee:CurrentSummationReceived",
name="Total Meter Energy Received",
name="Eagle-200 Total Meter Energy Received",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
device_class=DEVICE_CLASS_ENERGY,
state_class=STATE_CLASS_TOTAL_INCREASING,

View File

@ -114,17 +114,17 @@ async def test_sensors_200(hass, setup_rainforest_200):
"""Test the sensors."""
assert len(hass.states.async_all()) == 3
demand = hass.states.get("sensor.meter_power_demand")
demand = hass.states.get("sensor.eagle_200_meter_power_demand")
assert demand is not None
assert demand.state == "1.152000"
assert demand.attributes["unit_of_measurement"] == "kW"
delivered = hass.states.get("sensor.total_meter_energy_delivered")
delivered = hass.states.get("sensor.eagle_200_total_meter_energy_delivered")
assert delivered is not None
assert delivered.state == "45251.285000"
assert delivered.attributes["unit_of_measurement"] == "kWh"
received = hass.states.get("sensor.total_meter_energy_received")
received = hass.states.get("sensor.eagle_200_total_meter_energy_received")
assert received is not None
assert received.state == "232.232000"
assert received.attributes["unit_of_measurement"] == "kWh"
@ -147,17 +147,17 @@ async def test_sensors_100(hass, setup_rainforest_100):
"""Test the sensors."""
assert len(hass.states.async_all()) == 3
demand = hass.states.get("sensor.meter_power_demand")
demand = hass.states.get("sensor.eagle_200_meter_power_demand")
assert demand is not None
assert demand.state == "1.152000"
assert demand.attributes["unit_of_measurement"] == "kW"
delivered = hass.states.get("sensor.total_meter_energy_delivered")
delivered = hass.states.get("sensor.eagle_200_total_meter_energy_delivered")
assert delivered is not None
assert delivered.state == "45251.285000"
assert delivered.attributes["unit_of_measurement"] == "kWh"
received = hass.states.get("sensor.total_meter_energy_received")
received = hass.states.get("sensor.eagle_200_total_meter_energy_received")
assert received is not None
assert received.state == "232.232000"
assert received.attributes["unit_of_measurement"] == "kWh"