mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
parent
a0a5f640dc
commit
243c16d194
@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
|||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import UnitOfEnergy, UnitOfVolume
|
from homeassistant.const import EntityCategory, UnitOfEnergy, UnitOfVolume
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
|
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -91,6 +91,22 @@ ELEC_SENSORS: tuple[OpowerEntityDescription, ...] = (
|
|||||||
suggested_display_precision=0,
|
suggested_display_precision=0,
|
||||||
value_fn=lambda data: data.typical_cost,
|
value_fn=lambda data: data.typical_cost,
|
||||||
),
|
),
|
||||||
|
OpowerEntityDescription(
|
||||||
|
key="elec_start_date",
|
||||||
|
name="Current bill electric start date",
|
||||||
|
device_class=SensorDeviceClass.DATE,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
value_fn=lambda data: data.start_date,
|
||||||
|
),
|
||||||
|
OpowerEntityDescription(
|
||||||
|
key="elec_end_date",
|
||||||
|
name="Current bill electric end date",
|
||||||
|
device_class=SensorDeviceClass.DATE,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
value_fn=lambda data: data.end_date,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
GAS_SENSORS: tuple[OpowerEntityDescription, ...] = (
|
GAS_SENSORS: tuple[OpowerEntityDescription, ...] = (
|
||||||
OpowerEntityDescription(
|
OpowerEntityDescription(
|
||||||
@ -147,6 +163,22 @@ GAS_SENSORS: tuple[OpowerEntityDescription, ...] = (
|
|||||||
suggested_display_precision=0,
|
suggested_display_precision=0,
|
||||||
value_fn=lambda data: data.typical_cost,
|
value_fn=lambda data: data.typical_cost,
|
||||||
),
|
),
|
||||||
|
OpowerEntityDescription(
|
||||||
|
key="gas_start_date",
|
||||||
|
name="Current bill gas start date",
|
||||||
|
device_class=SensorDeviceClass.DATE,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
value_fn=lambda data: data.start_date,
|
||||||
|
),
|
||||||
|
OpowerEntityDescription(
|
||||||
|
key="gas_end_date",
|
||||||
|
name="Current bill gas end date",
|
||||||
|
device_class=SensorDeviceClass.DATE,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
value_fn=lambda data: data.end_date,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user