Hive R3 update (#13357)
* Rebase * Update version number to 0.2.14 * Remove Blank Line * Added period to docstring * Update Tox Fix * Removed Lines
This commit is contained in:
1 parent
595600dea5
commit
e0c5b44994
7 files changed
+72
-7
No files matched your search
@@ -28,6 +28,7 @@ class HiveDevicePlug(SwitchDevice):
|
||||
self.node_name = hivedevice["Hive_NodeName"]
|
||||
self.device_type = hivedevice["HA_DeviceType"]
|
||||
self.session = hivesession
|
||||
self.attributes = {}
|
||||
self.data_updatesource = '{}.{}'.format(self.device_type,
|
||||
self.node_id)
|
||||
self.session.entities.append(self)
|
||||
@@ -42,6 +43,11 @@ class HiveDevicePlug(SwitchDevice):
|
||||
"""Return the name of this Switch device if any."""
|
||||
return self.node_name
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Show Device Attributes."""
|
||||
return self.attributes
|
||||
|
||||
@property
|
||||
def current_power_w(self):
|
||||
"""Return the current power usage in W."""
|
||||
@@ -67,3 +73,5 @@ class HiveDevicePlug(SwitchDevice):
|
||||
def update(self):
|
||||
"""Update all Node data from Hive."""
|
||||
self.session.core.update_data(self.node_id)
|
||||
self.attributes = self.session.attributes.state_attributes(
|
||||
self.node_id)
|
||||
Reference in new issue
Block a user