-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Add Satel_integra switchable outputs and multiple partitions #21992
Add Satel_integra switchable outputs and multiple partitions #21992
Conversation
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.
This looks very good 👍. Just a couple of questions ...
Thanks for the review, Im on my vacation till next week, will fix it then. |
There is a merge conflict. |
Fixed, everything should be fine now. |
This comment has been minimized.
This comment has been minimized.
from homeassistant.core import callback | ||
from homeassistant.helpers import config_validation as cv | ||
from homeassistant.helpers.discovery import async_load_platform | ||
from homeassistant.helpers.dispatcher import async_dispatcher_send | ||
|
||
REQUIREMENTS = ['satel_integra==0.3.4'] |
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.
We have removed this. Please remove it. It's now enough to define the requirements in the manifest.json file and run the scripts to validate the manifest.
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.
Done - this was a merge error on my behalf.
|
||
async def async_alarm_arm_home(self, code=None): | ||
"""Send arm home command.""" | ||
_LOGGER.debug("Arming home") | ||
|
||
if code: | ||
await self.hass.data[DATA_SATEL].arm( | ||
code, self._arm_home_mode) | ||
await self._satel\ |
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.
Please break the line after the first parenthesis. That's the best way of formatting line breaks.
await self._satel.arm(
code, [self._partition_id], self._arm_home_mode)
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.
Fixed.
"""Support for Satel Integra modifiable outputs represented as switches.""" | ||
import logging | ||
|
||
|
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.
Please remove one blank line.
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.
Done.
@callback | ||
def _devices_updated(self, zones): | ||
"""Update switch state, if needed.""" | ||
_LOGGER.debug("Update switch name: %s zones: %s.", self._name, zones) |
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.
We don't end logging messages with period.
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.
Fixed.
Codecov Report
@@ Coverage Diff @@
## dev #21992 +/- ##
==========================================
+ Coverage 93.93% 93.94% +<.01%
==========================================
Files 451 451
Lines 36759 36758 -1
==========================================
Hits 34531 34531
+ Misses 2228 2227 -1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## dev #21992 +/- ##
==========================================
+ Coverage 93.93% 93.94% +<.01%
==========================================
Files 451 451
Lines 36759 36759
==========================================
+ Hits 34531 34532 +1
+ Misses 2228 2227 -1
Continue to review full report at Codecov.
|
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.
Great!
Description:
Added multiple partitions support as well as editable outputs, so one can use Satel outputs as switches. Additionally improved reporting of arming and disarming states of the alarm.
Breaking change:
The component now supports multiple partitions and this forced change in config: instead of single parameters
partition
andsingle_home_mode
there is now sectionpartitions:
. If your config so far was:... change it to:
... and your config will be OK again after upgrade.
Related issue (if applicable): fixes #21589, fixes #19796, fixes #19361.
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8922
Example entry for
configuration.yaml
(if applicable):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:
REQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices: