mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02: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:
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user