mirror of
https://github.com/home-assistant/core.git
synced 2025-08-07 14:45:09 +02:00
Fixed set_req not defined
This commit is contained in:
@@ -40,7 +40,6 @@ class MySensorsCover(mysensors.MySensorsDeviceEntity, CoverDevice):
|
|||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the controller with the latest value from a sensor."""
|
"""Update the controller with the latest value from a sensor."""
|
||||||
set_req = self.gateway.const.SetReq
|
|
||||||
node = self.gateway.sensors[self.node_id]
|
node = self.gateway.sensors[self.node_id]
|
||||||
child = node.children[self.child_id]
|
child = node.children[self.child_id]
|
||||||
for value_type, value in child.values.items():
|
for value_type, value in child.values.items():
|
||||||
@@ -51,6 +50,7 @@ class MySensorsCover(mysensors.MySensorsDeviceEntity, CoverDevice):
|
|||||||
@property
|
@property
|
||||||
def is_closed(self):
|
def is_closed(self):
|
||||||
"""Return True if cover is closed."""
|
"""Return True if cover is closed."""
|
||||||
|
set_req = self.gateway.const.SetReq
|
||||||
return self._values.get(set_req.V_PERCENTAGE) == 0
|
return self._values.get(set_req.V_PERCENTAGE) == 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -59,6 +59,7 @@ class MySensorsCover(mysensors.MySensorsDeviceEntity, CoverDevice):
|
|||||||
|
|
||||||
None is unknown, 0 is closed, 100 is fully open.
|
None is unknown, 0 is closed, 100 is fully open.
|
||||||
"""
|
"""
|
||||||
|
set_req = self.gateway.const.SetReq
|
||||||
return self._values.get(set_req.V_PERCENTAGE)
|
return self._values.get(set_req.V_PERCENTAGE)
|
||||||
|
|
||||||
def open_cover(self, **kwargs):
|
def open_cover(self, **kwargs):
|
||||||
|
Reference in New Issue
Block a user