Commit Graph

8 Commits (e45f2cf5a298251b511105019b357aae0db53f46)

Author SHA1 Message Date
Franck Nijhof bc5a2da7b7
Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
J. Nick Koston 18a4829314
Config flow for elkm1 (#33297)
* Config flow for elkm1

* As entity ids can now be changed, the “alarm_control_panel”
attribute “changed_by_entity_id” is now “changed_by_keypad”
and will show the name of the Elk keypad instead of the entity id.

* An auto configure mode has been introduced which avoids the
need to setup the complex include and exclude filters.  This
functionality still exists when configuring from yaml for power
users who want more control over which entities elkm1 generates.

* restore _has_all_unique_prefixes

* preserve legacy behavior of creating alarm_control_panels that have no linked keypads when auto_configure is False

* unroll loop
2020-03-27 15:38:35 -05:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
gjbadros 7d68def303 Support multiple Elk instances (#23839)
* Support multiple Elk instances

* Allow more than one Elk M1 alarm system to be integrated into a single hass instance.

* Introduces new "devices" schema at the top level, each of which has
  the prior configuration schema.

* Requires new version of elkm1, 0.7.14, that gwww and I just updated (thanks Glen!)

QUESTION: Should the "devices" section be optional to avoid breaking
old configuration files?  I chose not to do that for simplicity and
because I was following the doorbird code which requires the "devices"
section for all configurations even with only one device.

* Fixed a bunch of hound-raised issues

Fixed issues raised by hound -- there was clearly
a tool I was supposed to run to get those warnings
before submitting the PR.  Sorry!

Updated REQUIREMENTS.

* Fixed whitespace and line-length mistakes

Also fixed unused prefix local variable lint warning.

* Fixed missing blank line

* Fixed more lint warnings.

Not sure if I missed these on the first pass or if the linter stopped
after a certain number of warnings or something else.

Switched logging to use %d and %s instead of string concatenation (per
lint request and because I imagine it migth be better performing
in some (oldish, I presume) implementations of python.

* Fixed typo in last commit.

* Eliminate devices subsection in config schema

This eliminates the breaking change for configurations wanting a
singleton elk m1 instance (the majority of users, no doubt).  I did
not do it like this before because I was following the lead of the
doorbird component which introduced a devices: section when moving
to support multiple doorbells.  But Rohan Kapoor kindly pointed me
at the zoneminder component which sets the other (IMO) preferable
precedent. Will update the docs change shortly.

* Call async_add_entities once for all the elk controllers.

Just move async_add_entities() outside of the loops across the elk m1
controllers, so it's called once for each platform.

* Call async_add_entities only once per platform.

Move it to after the loop, so it's called only once
per platform even when there are multiple elk m1 controllers.

* Various improvements to be more idiomatic python + bug fixes

Thanks to Martin Hjelmare for the careful review and suggestions.
(All mistaken improvements and new bugs are my own.)

* Removed semicolon that lint caught.

* Idiomatic python improvements

Use dict.values() (instead of making it easier to add local looping variable
on the keys by using _, bar = ...items())

Use [] when the key is known to exist.

* Support multiple Elk instances

* Allow more than one Elk M1 alarm system to be integrated into a single hass instance.

* Introduces new "devices" schema at the top level, each of which has
  the prior configuration schema.

* Requires new version of elkm1, 0.7.14, that gwww and I just updated (thanks Glen!)

QUESTION: Should the "devices" section be optional to avoid breaking
old configuration files?  I chose not to do that for simplicity and
because I was following the doorbird code which requires the "devices"
section for all configurations even with only one device.

* Fixed a bunch of hound-raised issues

Fixed issues raised by hound -- there was clearly
a tool I was supposed to run to get those warnings
before submitting the PR.  Sorry!

Updated REQUIREMENTS.

* Fixed whitespace and line-length mistakes

Also fixed unused prefix local variable lint warning.

* Fixed missing blank line

* Fixed more lint warnings.

Not sure if I missed these on the first pass or if the linter stopped
after a certain number of warnings or something else.

Switched logging to use %d and %s instead of string concatenation (per
lint request and because I imagine it migth be better performing
in some (oldish, I presume) implementations of python.

* Fixed typo in last commit.

* Eliminate devices subsection in config schema

This eliminates the breaking change for configurations wanting a
singleton elk m1 instance (the majority of users, no doubt).  I did
not do it like this before because I was following the lead of the
doorbird component which introduced a devices: section when moving
to support multiple doorbells.  But Rohan Kapoor kindly pointed me
at the zoneminder component which sets the other (IMO) preferable
precedent. Will update the docs change shortly.

* Call async_add_entities once for all the elk controllers.

Just move async_add_entities() outside of the loops across the elk m1
controllers, so it's called once for each platform.

* Call async_add_entities only once per platform.

Move it to after the loop, so it's called only once
per platform even when there are multiple elk m1 controllers.

* Various improvements to be more idiomatic python + bug fixes

Thanks to Martin Hjelmare for the careful review and suggestions.
(All mistaken improvements and new bugs are my own.)

* Removed semicolon that lint caught.

* Idiomatic python improvements

Use dict.values() (instead of making it easier to add local looping variable
on the keys by using _, bar = ...items())

Use [] when the key is known to exist.

* Use dict[key] instead of .get (incl. fixing typo). Use .values() instead of .items() when ignoring keys.

* Gotta use devices.get(prefix) since we use no prefix for the singleton elk instance

* fix requirement to use newer elkm1 that supports my changes for multiple elk devices

* Removed spurious + between a string broken between two lines for formatting; was failing a lint check about logging needing to use %s

* Remove REQUIREMENTS and DEPENDENCIES since those are now taken care of by the manifest.json file.

* Add configuration check that the prefixes are all unique

* Use new dependency 'getmac' to get mac address of Elk M1 controllers and use that for uniqueid if possible, else use None.  Also removed some procedural checking of unique prefix since that's now handled at schema check time.

* Whitespace changes to make style checker happy and code more consistent

* Removed unused variable, added blank line

* Make getmac a requirement not dependency

I should've RTFM.

* ws only change; I really need to get Emacs to understand these style guidelines

* Ran script/gen_requirements_all.py; script/setup needed to be run so that was failing.

* More style check fixes and one bug fix.

* Incomplete set of changes from last push

* More conform-to-hass-style changes: use caps to start log message (and do not use function name even for debug message. And do not use string concatenation; prefer new-style .format.

* Style fixes.

* Switch back to using the prefix config field for setting the unique_id since the mac address approach has numerous shortcomings including: 1) new dependency; 2) lack of reliability; 3) doesn't work for serial connections; 4) breaks when a layer 4+ networking entity intermediates the elk m1 connection.

* Reran to update (removing getmac dependency)

* Skipped trailing ','; keep forgetting which languages are forgiving about this practical nicety of allowing trailing commas without changing the semantics.

* Validate uniqueness on lowercase versions of the prefix since we're gonna use .lower() on creating the entity id that has to be unique; do the _has_all_unique_prefixes check last so we get errors from the device schema before complaining about the uniqueness problem, if any

* Use vol.Lower to convert to lowercase instead of the map.  Also fixed a pair of bugs for the alarm control panel display message service -- since data templates always generate strings, the values subject to range/set restrictions need to be coerced to their proper type before the check

* Fix some flake8 warnings.

* Fixed typo; it's Coerce not coerce.

* Use elkm1m_ string to start unique_id when and only when there is a non-empty prefix given; this enables backward compatibility to avoid a breaking change by letting the elkm1_ start to unique_id keep working exactly as it used to.

* minor comment tweak to force automation tests to run again since they failed for unrelated reasons last time

* There's actually been a 0.7.15 release which was meta-information and tidying only so we might as well depend on it

* Forgot to update this with gen_requirements_all.py
2019-07-27 10:36:09 +02:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen 4b1de61110
Use relative imports inside integrations (#22235)
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Fabian Affolter 127c55e0c1
Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Paulus Schoutsen e2d3c27e85
Embed all platforms into components (#20677)
* Consolidate all components with platforms

* Organize tests

* Fix more tests

* Fix Verisure tests

* one final test fix

* Add change

* Fix coverage
2019-02-02 07:13:16 -08:00