-
-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Gogogate2 0.1.1 #14294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gogogate2 0.1.1 #14294
Changes from 6 commits
122835f
2db3f93
bef86ca
232ebfa
ea8b15e
75fcf07
7635b6f
3511b17
de324ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,10 @@ | |
| CoverDevice, SUPPORT_OPEN, SUPPORT_CLOSE) | ||
| from homeassistant.const import ( | ||
| CONF_USERNAME, CONF_PASSWORD, STATE_CLOSED, | ||
| CONF_IP_ADDRESS, CONF_NAME) | ||
| CONF_IP_ADDRESS, CONF_NAME, ATTR_TEMPERATURE) | ||
| import homeassistant.helpers.config_validation as cv | ||
|
|
||
| REQUIREMENTS = ['pygogogate2==0.0.7'] | ||
| REQUIREMENTS = ['pygogogate2==0.1.1'] | ||
|
|
||
| _LOGGER = logging.getLogger(__name__) | ||
|
|
||
|
|
@@ -70,6 +70,7 @@ def __init__(self, mygogogate2, device, name): | |
| self.device_id = device['door'] | ||
| self._name = name or device['name'] | ||
| self._status = device['status'] | ||
| self._temperature = device['temperature'] | ||
| self._available = None | ||
|
|
||
| @property | ||
|
|
@@ -92,6 +93,13 @@ def supported_features(self): | |
| """Flag supported features.""" | ||
| return SUPPORT_OPEN | SUPPORT_CLOSE | ||
|
|
||
| @property | ||
| def state_attributes(self): | ||
| """Return the state attributes.""" | ||
| data = super().state_attributes | ||
| data[ATTR_TEMPERATURE] = self._temperature | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be added as an attribute but instead be made into it's own sensor. This means that you will need to greate a gogogate2 component to handle the connection and then setup the cover and sensor platforms.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair enough. For now, I'll update the PR to get the bug fix in and look at adding the component/sensors later. For additional data points such as battery_level of the garage tilt sensor - should that be added as an attribute of the cover platform or should it be its own sensor too? |
||
| return data | ||
|
|
||
| @property | ||
| def available(self): | ||
| """Could the device be accessed during the last update call.""" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined name 'ATTR_TEMPERATURE'