mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
parent
ffdcdaf43b
commit
3bd1162650
@ -197,7 +197,7 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_DAY,
|
sensor_type=SENSOR_TYPE_THIS_DAY,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
icon="mdi:counter",
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
@ -207,7 +207,7 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
sensor_type=SENSOR_TYPE_THIS_WEEK,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
icon="mdi:counter",
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
@ -217,7 +217,7 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
sensor_type=SENSOR_TYPE_THIS_MONTH,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
icon="mdi:counter",
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
@ -227,7 +227,7 @@ SENSORS_INFO = [
|
|||||||
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
native_unit_of_measurement=UnitOfVolume.CUBIC_METERS,
|
||||||
key=SOURCE_TYPE_GAS,
|
key=SOURCE_TYPE_GAS,
|
||||||
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
sensor_type=SENSOR_TYPE_THIS_YEAR,
|
||||||
state_class=SensorStateClass.TOTAL,
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
icon="mdi:counter",
|
icon="mdi:counter",
|
||||||
precision=1,
|
precision=1,
|
||||||
),
|
),
|
||||||
|
@ -289,7 +289,10 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert gas_today.state == "1.1"
|
assert gas_today.state == "1.1"
|
||||||
assert gas_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_today.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_today.attributes.get(ATTR_ICON) == "mdi:counter"
|
assert gas_today.attributes.get(ATTR_ICON) == "mdi:counter"
|
||||||
assert gas_today.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
assert (
|
||||||
|
gas_today.attributes.get(ATTR_STATE_CLASS)
|
||||||
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
|
)
|
||||||
assert (
|
assert (
|
||||||
gas_today.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
gas_today.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
== UnitOfVolume.CUBIC_METERS
|
== UnitOfVolume.CUBIC_METERS
|
||||||
@ -299,7 +302,10 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert gas_this_week.state == "5.6"
|
assert gas_this_week.state == "5.6"
|
||||||
assert gas_this_week.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_week.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_week.attributes.get(ATTR_ICON) == "mdi:counter"
|
assert gas_this_week.attributes.get(ATTR_ICON) == "mdi:counter"
|
||||||
assert gas_this_week.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
assert (
|
||||||
|
gas_this_week.attributes.get(ATTR_STATE_CLASS)
|
||||||
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
|
)
|
||||||
assert (
|
assert (
|
||||||
gas_this_week.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
gas_this_week.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
== UnitOfVolume.CUBIC_METERS
|
== UnitOfVolume.CUBIC_METERS
|
||||||
@ -309,7 +315,10 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert gas_this_month.state == "39.1"
|
assert gas_this_month.state == "39.1"
|
||||||
assert gas_this_month.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_month.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_month.attributes.get(ATTR_ICON) == "mdi:counter"
|
assert gas_this_month.attributes.get(ATTR_ICON) == "mdi:counter"
|
||||||
assert gas_this_month.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
assert (
|
||||||
|
gas_this_month.attributes.get(ATTR_STATE_CLASS)
|
||||||
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
|
)
|
||||||
assert (
|
assert (
|
||||||
gas_this_month.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
gas_this_month.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
== UnitOfVolume.CUBIC_METERS
|
== UnitOfVolume.CUBIC_METERS
|
||||||
@ -319,7 +328,10 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
|||||||
assert gas_this_year.state == "116.7"
|
assert gas_this_year.state == "116.7"
|
||||||
assert gas_this_year.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
assert gas_this_year.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.GAS
|
||||||
assert gas_this_year.attributes.get(ATTR_ICON) == "mdi:counter"
|
assert gas_this_year.attributes.get(ATTR_ICON) == "mdi:counter"
|
||||||
assert gas_this_year.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL
|
assert (
|
||||||
|
gas_this_year.attributes.get(ATTR_STATE_CLASS)
|
||||||
|
is SensorStateClass.TOTAL_INCREASING
|
||||||
|
)
|
||||||
assert (
|
assert (
|
||||||
gas_this_year.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
gas_this_year.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
== UnitOfVolume.CUBIC_METERS
|
== UnitOfVolume.CUBIC_METERS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user