Commit Graph

58 Commits (6c41786be46fcad78e053e1457042bb90d051f06)

Author SHA1 Message Date
James Hewitt 494ae9aef6
Clean up RFXtrx tests (#67278)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-27 01:49:46 +01:00
James Hewitt 069e70ff03
Add mode setting to RFXtrx device configuration (#67173)
This allows users to configure the modes on their RFXtrx device without
downloading additional software that only runs on Windows. It also
enables the use of modes that cannot be permanently enabled on the
device, such as for undecoded and raw messages.
2022-02-25 20:43:29 +01:00
Joakim Plate 8a74295d6f
Add support for rfxtrx sirens and chimes (#66416)
* Add support for sirens and chimes

* Fixup testing

* Fixup comments

* Hook up existing off delay

* Add docs for off delay.

* Rename mixin
2022-02-25 07:53:22 +01:00
Joakim Plate 9906717e33
Use opt in device removal for rfxtrx (#58252) 2022-02-23 20:17:48 +01:00
Niels AD ccdf182d31
rfxtrx: Add command_on/command_off support for pt2262 switch entities (#65798) 2022-02-06 19:39:57 +01:00
Franck Nijhof 176f03d4ac
Allow toggles (switches) state to be None (#64621) 2022-01-23 11:31:01 +01:00
Franck Nijhof 60b2cdd069
Allow binary sensor state to be None (#60193) 2021-12-22 12:24:29 +01:00
Ville Skyttä f913961d63
Use DeviceAutomationType in tests/components/[m-r]* (#62443) 2021-12-20 22:29:22 +01:00
Joakim Plate f0b3fbc5a7
Always fire event for known devices in rfxtrx (#58845) 2021-11-16 19:03:18 +01:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Joakim Plate 9b00e0cb7a
Rfxtrx device triggers and actions (#47909)
* Add helper

* Add device actions

* Add trigger

* Just make use of standard command

* Generalize code a bit

* Switch tests to currently existing features

* Add tests for capabilities

* Don't check schema asserted value

* Adjust strings somewhat

* Directly expose action subtypes

* Add a status event test

* Switch to modern typing

* Drop chime that is now part of command

* Adjust strings a bit

* Drop ability to set custom value

* Adjust changed base schema

* Validate triggers

* Try fix typing for 3.8
2021-09-17 15:28:43 +02:00
Erik Montnemery 797b68b42d
Prevent 3rd party lib from opening sockets in rfxtrx tests (#56331) 2021-09-17 12:51:40 +02:00
Joakim Plate a8cbb949fa
Rfxtrx drop yaml configuration (#54173) 2021-09-08 22:17:02 -07:00
Børge Nordli 87165d6133
Support group events for AC switches and binary sensors. Fixes #53065. (#53384)
* Support group events for AC switches and binary sensors. Fixes #53065.

* Review comments
2021-07-23 18:45:31 +02:00
Rob Bierbooms ff0c753c87
Bump pyRFXtrx to 0.27.0 (#51911)
* Bump version

* Fix test
2021-06-15 20:34:05 -05:00
Ville Skyttä 19d25cd901
Change config entry state to an enum (#49654)
* Change config entry state to an enum

* Allow but deprecate EntryState str equality comparison

* Test fixes

* Rename to ConfigEntryState

* Remove str comparability backcompat

* Update new occurrences of strs cropped up during review
2021-05-20 19:19:20 +02:00
Erik Montnemery ba2978c693
Update tests p-s to use async_get() instead of async_get_registry() (#47654) 2021-03-09 14:28:32 +01:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Ville Skyttä 2fb3be50ab
Make DeviceRegistry.async_get_device connections arg optional (#44897)
* Make async_get_device connections Optional, default None

* Remove unnecessary async_get_device connections arg usages

Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.
2021-01-07 13:49:45 +01:00
Joakim Plate c1027cace6
Add device entry id to events (#44407)
* Add device entry id to events

* Only add device id if device is known for now
2021-01-04 15:31:10 +01:00
dzukero 2ed7b90027
Add RFXtrx Rfy venetian blinds tilt control (#44309)
* Add tilt control for RFXtrx Rfy venetian blinds

* Update Rfy cover test

* Update the required version of pyRFXtrx

* Update required pyRFXtrx version to 0.26.1

* Revert "Update required pyRFXtrx version to 0.26.1"

This reverts commit d54f1645d5.

* Revert "Update the required version of pyRFXtrx"

This reverts commit ac36d65326.

* Update required version of pyRFXtrx to 0.26.1

* @dzukero
Update required version of pyRFXtrx to 0.26.1

* Make requested changes from review

* Fix isort

* Remove set tilt position support

* Remove set tilt position support per review
2021-01-03 12:59:22 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Alexei Chetroi 6253054fd4
Bump up dependencies on pyserial and pyserial-asyncio (#44089) 2020-12-10 20:41:31 +01:00
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Simone Chemelli 7554c8d6c5
Add missing unit for signal strength (#40436)
* Added missing unit for signal strength

* Added one more unit

* Replaced string with variable

* Fixed wrong import

* Fix import

* Replaced string with variable

* Fixed wrong import

* Apply suggestions from code review

* Black

* Again a fix :-(

* iSort

* iSort after merge

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-10-01 16:14:29 +02:00
Rob Bierbooms c5041b41c8
Implement config and option flow for rfxtrx integration (#39117)
* Create option flow for Rfxtrx integration (#37982)

* Implement config flow for rfxtrx integration (#39299)

* Add config flow

* Add strings

* Add first series of tests

* Add tests

* Adjust tests according review comments

* Adjust strings

* Add executor for testing connection

* Change ports to dict

* Fix pylint issue

* Adjust tests

* Migrate config entry for rfxtrx integration (#39528)

* Add rfxtrx device connection validation when importing (#39582)

* Implement import connection validation

* Fix binary sensor tests

* Move rfxtrx data

* Fix cover tests

* Fix test init

* Fix light tests

* Fix sensor tests

* Fix switch tests

* Refactor rfxtrx test data

* Fix strings

* Fix check

* Rework device string in test code

* Add option to delete multiple rfxtrx devices (#39625)

* Opt to remove multiple devices

* Fix devices key

* Add tests (phase 1)

* Add tests (phase 2)

* Tweak remove devices test

* Implement device migration function in rfxtrx option flow (#39694)

* Prompt option to replace device

* Revert unwanted changes

* Add replace device function

* WIP replace entities

* Remove device/entities and update config entry

* Fix styling

* Add info

* Add test

* Fix strings

* Refactor building migration map

* Allow migration for all device types

* Add test to migrate control device

* Fixup some names

* Fixup entry names in test code

* Bump pyRFXtrx to 0.26 and deprecate debug config key (#40679)

* Create option flow for Rfxtrx integration (#37982)

* Implement config flow for rfxtrx integration (#39299)

* Add config flow

* Add strings

* Add first series of tests

* Add tests

* Adjust tests according review comments

* Adjust strings

* Add executor for testing connection

* Change ports to dict

* Fix pylint issue

* Adjust tests

* Migrate config entry for rfxtrx integration (#39528)

* Add rfxtrx device connection validation when importing (#39582)

* Implement import connection validation

* Fix binary sensor tests

* Move rfxtrx data

* Fix cover tests

* Fix test init

* Fix light tests

* Fix sensor tests

* Fix switch tests

* Refactor rfxtrx test data

* Fix strings

* Fix check

* Rework device string in test code

* Add option to delete multiple rfxtrx devices (#39625)

* Opt to remove multiple devices

* Fix devices key

* Add tests (phase 1)

* Add tests (phase 2)

* Tweak remove devices test

* Implement device migration function in rfxtrx option flow (#39694)

* Prompt option to replace device

* Revert unwanted changes

* Add replace device function

* WIP replace entities

* Remove device/entities and update config entry

* Fix styling

* Add info

* Add test

* Fix strings

* Refactor building migration map

* Allow migration for all device types

* Add test to migrate control device

* Fixup some names

* Fixup entry names in test code

* Bump version number

* Remove debug key from connect

* Remove debug option from config flow

* Remove debug from tests

* Fix event test

* Add cv.deprecated

* Fix test

* Fix config schema

* Add timeout on connection

* Rework config schema

* Fix schema...again

* Prevent creation of duplicate device in rfxtrx option flow (#40656)
2020-10-01 08:55:57 +02:00
Joakim Plate 0fbeb3bf7b
Use HA constants for Rfxtrx units (#40562)
* Add more units and device classes

* Battery level is a value beteen 0 and 9 where 9 indicate full

Actual 0 battery can't occur since since then we would get to signal

* Adjust tests

* Add wind direction and adjust rain rate

* Adjust data types to be None rather than empty string

* Set counter values to count unit

* Forgotten unit
2020-09-25 08:27:38 -04:00
Ville Skyttä 5e90a4d000
Use more state attribute name constants (#40428) 2020-09-21 23:03:39 +02:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Rob Bierbooms 5658a1efec
Increase test coverage for rfxtrx integration (#39340)
* Increase switch coverage

* Increase binary sensor coverage

* Final improvements

* Remove debug statement

* Adjust test duplicate cover

* Remove None return test

* Assert on length of conf_entries

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-08-28 15:05:11 -05:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Rob Bierbooms af97141f4f
Increase test coverage for rfxtrx integration (#38435)
* Remove rfxtrx from coveragerc

* Tweak binary sensor test

* Tweak light test
2020-08-01 11:26:26 -05:00
Joakim Plate 0bcee21333
Restore rfxtrx state to off when delay off is in effect (#38239) 2020-07-28 01:45:41 +02:00
Joakim Plate fd11748a1a
Make rfxtrx RfyDevices have sun automation switches (#38210)
* RfyDevices have sun automation

* We must accept sun automation commands for switch

* Add test for Rfy sun automation
2020-07-25 22:56:58 +02:00
Joakim Plate 632a36d819
Support rfxtrx smoke detectors, motion sensors as binary_sensors (#38000)
* Add binary sensor support to motion sensors and smoke detectors

* Add support for new sensor events as binary sensors

Adds a default device_class for motion sensors and smoke detector

* Use device type instead of event to set class

* Add some additional binary values
2020-07-24 17:16:41 +02:00
Rob Bierbooms 0e0f61764a
Fix updates of Rssi for control devices in rfxtrx (#38131)
* Change entity to entity_info

* Fix bug in RSSI for Control devices
2020-07-24 01:49:46 +02:00
Joakim Plate 7a3c6d6525
Avoid using implementation internal to trigger events (#38041)
This uses the moxking in fixture to trigger events.
2020-07-22 00:24:26 +02:00
Joakim Plate 945acb4e29
Make sure command entities restore from state (#38038) 2020-07-22 00:01:31 +02:00
Rob Bierbooms ad5d7ee615
Implement unload entry for rfxtrx integration (#38037)
* Implement unload entry

* Change async_remove to remove

* Pop data from hass.data

* Change sequence order in unload

* Dont unload internal when unload platforms fail
2020-07-21 23:43:05 +02:00
Joakim Plate 1a64108eea
Switch rfxtrx to config entries (#37794)
* Switch to config flow setup

* Add minimal test for config flow

* Add myself as codeowner and address some review concerns

* Address some further review comments
2020-07-13 23:24:28 +02:00
Joakim Plate ccbc3b5e39
Add rfxtrx ability to send a raw command to device (#37793)
* Add the ability to send a raw command to device

* Add a test for new service

* Use async test

* Sort includes
2020-07-13 16:54:52 +02:00
Joakim Plate aaa073183c
Drop dummy connection (#37805)
We now mock the module
2020-07-13 03:40:45 +02:00
Joakim Plate 87f6b7cdd4
Replace rfxtrx entity events with integration events (#37565)
* Drop per entity events

* Correct linting error

* Drop keys()
2020-07-13 02:57:19 +02:00
Joakim Plate 53844488d8
Switch rfxtrx to integration level config (#37742)
* Switch to integration level config

* Switch to per device config rather than per entity type

* All roller shutters should be added as covers

(there are non lighting types)

* Fixup tests that used invalid packets for platforms

* Avoid variable re-use

* Allow control events on sensors too

That way we get signal level sensors for these too

* Lint correction

* Don't filter sensors from config

Disable sensors from GUI if the entities are not wanted

* Correct usage of ATTR_ instead of CONF_

* Make sure the logging when a new entity is added includes the event
2020-07-12 22:03:22 +02:00
Joakim Plate 5255bf20d3
Add rfxtrx device classes to known types (#37698)
* Add device classes to known types

* Update homeassistant/components/rfxtrx/sensor.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-10 21:47:37 +02:00
Joakim Plate 67038c6ba8
Rewrite rfxtrx init logic to do away with global object (#37699)
* Rewrite init logic to do away with global object

* Put constant at end

* Use a set instead of list for device_ids
2020-07-10 14:52:07 +02:00
Joakim Plate 2088092f7c
Switch rfxtrx to dispatcher (#37271)
* Switch to dispatcher

* Adjust tests for dispatcher

* Store device in sensor

* Move state application into binary sensor entity class

* Move more specifics into per platform classes

* Should not apply event in init of sensor

* Switch to call_later

* Make apply_event public

* No point in slugifying debug logs

* Adjust error in off delay and event

* Make sure we match with masked id
2020-07-06 00:10:26 +02:00
Joakim Plate 01fd33f173
Switch tests to use hass objects instead of direct (#37530)
* Switch tests to use hass objects instead of direct

* Make sure sensor update state

* Add some initial binary sensor tests

* Add initial binary sensor tests

* Add tests for pt2262

* Add test for off delay
2020-07-05 22:41:11 +02:00
Joakim Plate ab4687d914
Convert rfxtrx tests to pytest async tests and re-enable (#37206)
* Rework and re-enable rfxtrx tests

* Add missed change to _signal_event

* Fixup the dummy serial that causes max cpu

* Make sure we cleanup thread here too

* Make sure we always wait for tasks before we check state

* Some more places we need to wait before checking
2020-07-03 10:22:02 +02:00
Joakim Plate 464f17f182
Fixup rfxtrx tests to at least run (#37186) 2020-06-27 21:54:27 -07:00