Add watt to mysensors switch attributes (#13370)
This commit is contained in:
parent
2d7d8848cb
commit
17cbd0f3c9
1 changed files with 6 additions and 0 deletions
|
@ -72,6 +72,12 @@ class MySensorsSwitch(mysensors.MySensorsEntity, SwitchDevice):
|
|||
"""Return True if unable to access real state of entity."""
|
||||
return self.gateway.optimistic
|
||||
|
||||
@property
|
||||
def current_power_w(self):
|
||||
"""Return the current power usage in W."""
|
||||
set_req = self.gateway.const.SetReq
|
||||
return self._values.get(set_req.V_WATT)
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return True if switch is on."""
|
||||
|
|
Loading…
Add table
Reference in a new issue