mirror of
https://github.com/home-assistant/core.git
synced 2025-12-26 14:08:21 +00:00
Black
This commit is contained in:
@@ -15,8 +15,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
return
|
||||
|
||||
add_entities(
|
||||
[FibaroSwitch(device) for
|
||||
device in hass.data[FIBARO_DEVICES]['switch']], True)
|
||||
[FibaroSwitch(device) for device in hass.data[FIBARO_DEVICES]["switch"]], True
|
||||
)
|
||||
|
||||
|
||||
class FibaroSwitch(FibaroDevice, SwitchDevice):
|
||||
@@ -41,14 +41,14 @@ class FibaroSwitch(FibaroDevice, SwitchDevice):
|
||||
@property
|
||||
def current_power_w(self):
|
||||
"""Return the current power usage in W."""
|
||||
if 'power' in self.fibaro_device.interfaces:
|
||||
if "power" in self.fibaro_device.interfaces:
|
||||
return convert(self.fibaro_device.properties.power, float, 0.0)
|
||||
return None
|
||||
|
||||
@property
|
||||
def today_energy_kwh(self):
|
||||
"""Return the today total energy usage in kWh."""
|
||||
if 'energy' in self.fibaro_device.interfaces:
|
||||
if "energy" in self.fibaro_device.interfaces:
|
||||
return convert(self.fibaro_device.properties.energy, float, 0.0)
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user