Add support for Tahoma smoke sensor, light switch and two awning io components#14931
Add support for Tahoma smoke sensor, light switch and two awning io components#14931fucm wants to merge 17 commits intohome-assistant:devfrom
Conversation
- 'io:VerticalExteriorAwningIOComponent': 'cover' - 'io:HorizontalAwningIOComponent': 'cover' - 'io:OnOffLightIOComponent': 'switch' - 'rtds:RTDSSmokeSensor': 'smoke'
- 'io:VerticalExteriorAwningIOComponent': 'cover' - 'io:HorizontalAwningIOComponent': 'cover' - 'io:OnOffLightIOComponent': 'switch' - 'rtds:RTDSSmokeSensor': 'smoke'
- all: provide available state attributes - binary_sensor: smoke sensor can show battery warning icon - sensor: increase sensor update time from 10s to 120s
More test cases to cover retry logic added in 58a1c38
…me-assistant#14823) * start arlo refactoring * Refactored Arlo Hub to avoid uncessary and duplicated GETs to Arlo API * Refactored Arlo camera component to avoid duplicate queries * Added debug and error messages when video is not found * Transformed Arlo Control Panel to Sync * Makes linter happy * Uses total_seconds() for scan_interval * Added callback and fixed scan_interval issue * Disable multiple tries and supported custom modes set in Arlo * Bump PyArlo version to 0.1.4 * Makes lint happy * Removed ArloHub object and added some tweaks * Fixed hub_refresh method * Makes lint happy * Ajusted async syntax and added callbacks decorators * Bump PyArlo version to 0.1.6 to include some enhacements * Refined code
* initial commit for kiwi door locks bugfixes improved attribute display flake8 more style adjustments * added session handling flake8 * added requirements_all reordered imports and flake8 attempt to pelase a very picky linter also pleasing pylint now :) * re-try the build * added kiwi.py to .coveragerc * reorganized datetime handling and attribute naming * created pypi package for door lock library * updated requirements_all.txt * code review changes * added async lock state reset for locking state * refactored lat/lon attribute updates * initial locked state changed from undefined to locked * refactored is_locked property check * handling authentication exception in setup_platform * added more check in setup_platform * code review changes: return type in setup_platform * fixed logging issue * event handling in main thread * updated kiwiki-client to version 0.1.1 * renamed alias e to exc
Current uuid is ok when using only 1 snapserver New uuid is needed when using multiple snapserver Because the client can connect to more snapservers and then uuid based on client MAC is not enough
- 'io:VerticalExteriorAwningIOComponent': 'cover' - 'io:HorizontalAwningIOComponent': 'cover' - 'io:OnOffLightIOComponent': 'switch' - 'rtds:RTDSSmokeSensor': 'smoke'
- all: provide available state attributes - binary_sensor: smoke sensor can show battery warning icon - sensor: increase sensor update time from 10s to 120s
| except KeyError: | ||
| return None | ||
| if self._position <= 5: | ||
| self._position = 0 |
There was a problem hiding this comment.
Actually, I don't know. It was there since the beginning (#10652). So, I kept the code.
| return None | ||
|
|
||
| @property | ||
| def state_attributes(self): |
There was a problem hiding this comment.
Do not override state_attributes. Devices can override device_state_attributes
|
|
||
| _LOGGER = logging.getLogger(__name__) | ||
|
|
||
| ATTR_CLOSURE = 'closure' |
There was a problem hiding this comment.
Please limit PRs to 1 feature per PR next time. So changes to binary sensor and cover: 2 prs.
There was a problem hiding this comment.
I will do so in the future. Sorry.
| attr[ATTR_STATUS] = self.tahoma_device.active_states[ | ||
| 'core:StatusState'] | ||
| if self._lock_timer is not None: | ||
| attr[ATTR_LOCK_TIMER] = self._lock_timer |
There was a problem hiding this comment.
We should store any times in the state machine. Only time stamps are allowed.
There was a problem hiding this comment.
I read the docs about the states again and I don't understand, why the lock timer should go into the state machine. It's an attribute of the device for how long it is locked (before it can be used again, e.g. open cover after wind has been detected). It relates directly to lock_level and lock_originator. Could you please point me to an example or the appropriate documentation?
There was a problem hiding this comment.
You can store timestamps, so store the exact time when it can be used. Don't store relative times that change on every update.
| return bool(self._state == STATE_ON) | ||
|
|
||
| @property | ||
| def state_attributes(self): |
| self.tahoma_device.active_states['core:StatusState'] | ||
| if 'core:PriorityLockTimerState' in self.tahoma_device.active_states: | ||
| attr[ATTR_LOCK_TIMER] = \ | ||
| self.tahoma_device.active_states['core:PriorityLockTimerState'] |
There was a problem hiding this comment.
Is this the same info as the cover?
There was a problem hiding this comment.
Yes, it is the same type of info, but from the switch. Actually I do not know, for what the PriorityLockTimerState is used in case of a switch. For example a cover is blocked by a wind sensor for a certain time, in case of strong wind.
|
@balloob is anything open from your review? I don't plan any other changes. |
|
It seems like you have some commits in this branch that are not yours, please clean it up. |
|
I do not understand where those commits are coming from! My branch looks clean, but the pull request contains the additional commits, which seem to be from other pull requests. Any hint what I could do now? How can I clean it up? |
|
I will create smaller pull requests for each component. Closing this pull request. |
Description:
Add support for 4 Tahoma devices:
Additional improvements:
Related issue (if applicable): fixes #13965
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5590
Example entry for
configuration.yaml(if applicable):nothing
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
components/*/tahoma.py(.coveragerc).If the code does not interact with devices: