mirror of
https://github.com/home-assistant/core.git
synced 2025-12-23 20:39:01 +00:00
Fix wrapper and S_BINARY and bump req. version
* Wrap existing SerialGateway instance instead of subclassing SerialGatewat class. * Add S_BINARY in switch platform only in version 1.5 of mysenors api. * Use version 0.4 of pymysensors. * Show gateway port as state attribute.
This commit is contained in:
@@ -78,14 +78,14 @@ class MySensorsSensor(Entity):
|
||||
"""Setup class attributes on instantiation.
|
||||
|
||||
Args:
|
||||
gateway (str): Gateway.
|
||||
gateway (GatewayWrapper): Gateway object.
|
||||
node_id (str): Id of node.
|
||||
child_id (str): Id of child.
|
||||
name (str): Entity name.
|
||||
value_type (str): Value type of child. Value is entity state.
|
||||
|
||||
Attributes:
|
||||
gateway (str): Gateway.
|
||||
gateway (GatewayWrapper): Gateway object.
|
||||
node_id (str): Id of node.
|
||||
child_id (str): Id of child.
|
||||
_name (str): Entity name.
|
||||
@@ -154,6 +154,7 @@ class MySensorsSensor(Entity):
|
||||
def state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
data = {
|
||||
mysensors.ATTR_PORT: self.gateway.port,
|
||||
mysensors.ATTR_NODE_ID: self.node_id,
|
||||
mysensors.ATTR_CHILD_ID: self.child_id,
|
||||
ATTR_BATTERY_LEVEL: self.battery_level,
|
||||
|
||||
Reference in New Issue
Block a user