Allow customizing display name for energy device (#112834)

* Allow customizing display name for energy device

* optional typing and comment
This commit is contained in:
karwosts 2024-04-12 11:31:51 -07:00 committed by GitHub
parent b266224ccd
commit 77d1e2c812
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,6 +136,9 @@ class DeviceConsumption(TypedDict):
# This is an ever increasing value
stat_consumption: str
# An optional custom name for display in energy graphs
name: str | None
class EnergyPreferences(TypedDict):
"""Dictionary holding the energy data."""
@ -287,6 +290,7 @@ ENERGY_SOURCE_SCHEMA = vol.All(
DEVICE_CONSUMPTION_SCHEMA = vol.Schema(
{
vol.Required("stat_consumption"): str,
vol.Optional("name"): str,
}
)