mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Allow customizing display name for energy device (#112834)
* Allow customizing display name for energy device * optional typing and comment
This commit is contained in:
parent
b266224ccd
commit
77d1e2c812
@ -136,6 +136,9 @@ class DeviceConsumption(TypedDict):
|
|||||||
# This is an ever increasing value
|
# This is an ever increasing value
|
||||||
stat_consumption: str
|
stat_consumption: str
|
||||||
|
|
||||||
|
# An optional custom name for display in energy graphs
|
||||||
|
name: str | None
|
||||||
|
|
||||||
|
|
||||||
class EnergyPreferences(TypedDict):
|
class EnergyPreferences(TypedDict):
|
||||||
"""Dictionary holding the energy data."""
|
"""Dictionary holding the energy data."""
|
||||||
@ -287,6 +290,7 @@ ENERGY_SOURCE_SCHEMA = vol.All(
|
|||||||
DEVICE_CONSUMPTION_SCHEMA = vol.Schema(
|
DEVICE_CONSUMPTION_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required("stat_consumption"): str,
|
vol.Required("stat_consumption"): str,
|
||||||
|
vol.Optional("name"): str,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user