Correct Goalzero sensor state class (#96122)

pull/96131/head
Robert Hillis 2023-07-08 02:52:15 -04:00 committed by GitHub
parent a6fe53f2b3
commit 8bfac2c46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
name="Wh stored",
device_class=SensorDeviceClass.ENERGY,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
state_class=SensorStateClass.MEASUREMENT,
state_class=SensorStateClass.TOTAL,
),
SensorEntityDescription(
key="volts",

View File

@ -66,7 +66,7 @@ async def test_sensors(
assert state.state == "1330"
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.WATT_HOUR
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.MEASUREMENT
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.TOTAL
state = hass.states.get(f"sensor.{DEFAULT_NAME}_volts")
assert state.state == "12.0"
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.VOLTAGE