mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Add precision_hint to feature (#871)
This can be used to hint how the sensor value should be rounded when displaying it to users. The values are adapted from the values used by homeassistant.
This commit is contained in:
@@ -26,6 +26,7 @@ class EnergyModule(SmartModule):
|
||||
attribute_getter="current_power",
|
||||
container=self,
|
||||
unit="W",
|
||||
precision_hint=1,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
@@ -35,6 +36,7 @@ class EnergyModule(SmartModule):
|
||||
attribute_getter="emeter_today",
|
||||
container=self,
|
||||
unit="Wh",
|
||||
precision_hint=2,
|
||||
)
|
||||
)
|
||||
self._add_feature(
|
||||
@@ -44,6 +46,7 @@ class EnergyModule(SmartModule):
|
||||
attribute_getter="emeter_this_month",
|
||||
container=self,
|
||||
unit="Wh",
|
||||
precision_hint=2,
|
||||
)
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user