Commit Graph

33 Commits (05de7a78d1c87b7bcdce9dbba7d89aa4ec7db3d3)

Author SHA1 Message Date
Joakim Plate 422fe48c3a
Correct device class typo in rfxtrx (#54200) 2021-08-07 12:15:31 +02:00
Joakim Plate 13e7cd237e
Convert to using sensor descriptors (#54115) 2021-08-06 09:56:51 -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 1fe66df962
Cleanup dispatchers when unloading rfxtrx (#42803)
* Cleanup dispatchers

* Fix name

* Refactor code

* Fix typo in function description

* Fix pylint error

* Change function definition

* Move cleanup_callbacks data to domain
2020-11-04 11:30:46 +01: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
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02: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 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 945acb4e29
Make sure command entities restore from state (#38038) 2020-07-22 00:01:31 +02:00
Rob Bierbooms d9dba9142c
Move data on import in rfxtrx integration into ConfigEntry (#38022)
* Move all data imported from yaml to ConfigEntry

* Revert changes that prevent updating yaml entry

* Cleanup code around time conversion
2020-07-21 09:44:00 +02:00
Joakim Plate f173805c2f
Make sensor and binary_sensor inherit from base class (#37946)
* Make sensor and binary_sensor inherit from base class

* Drop several pointless public properties

* Make sure base function has same parameters

* Drop pass

* Missed one

* Adjust inherit order
2020-07-18 13:43:38 +02:00
Joakim Plate d0040e60cc
Rftrx force update (#37944)
* Make sure sensor and binary_sensor force update

This make sure it's possible to react to events on all updates.

* Correct addition of binary sensors
2020-07-18 01:23:49 +02:00
Joakim Plate 7c9be024bb
Rfxtrx use previous received event to do complete restore (#37819)
* Add event attribute to display last received event

* Restore state using event attribute

* Allow empty dict for device config

* Must also validate normal case

* Do early return
2020-07-17 10:27:07 +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 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 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 a3310330f4
Split handling and application of event (#37665)
This way _handle_event can contain things available
when entity has been added to home assistant,
and _apply event can remain internal and used on init.
2020-07-09 11:40:37 +02:00
Joakim Plate d0983b69df
Switch what is used for unique identifier (#37581)
* Switch what is used for device identifier

type_string can be changed if new device types are added based
on same driver.

* No need to slugify unique id
2020-07-07 21:50:19 +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 201dab93ff
Attempt to set unique id of rfxtrx device (#37159) 2020-06-27 21:59:42 -07:00
Erik Montnemery b022e08db9
Rename BinarySensorDevice to BinarySensorEntity (#34462)
* Rename BinarySensorDevice to BinarySensorEntity

* Tweak

* Move deprecation warning to __new__, add test

* Move deprecation warning back to __init__

* Move deprecation warning to __init_subclass
2020-04-23 21:57:07 +02:00
foxy82 a08e3d7352 Update rfxtrx component so it can be run as a custom_component (#29638)
* Updating rfxtrx component so it can be run as a custom_component

* Fix pylint errors

* Fix pylint errors

* Fix pylint error on dict.

* isort
2019-12-11 15:58:49 +01:00
javicalle de7963544f Apply isort on rfxtrx classes (#27615)
* Move imports in rfxtrx component

* Apply isort on rfxtrx files

* Update test_switch.py
2019-10-14 10:38:34 -05:00
javicalle 40e5beb0ed Move imports in rfxtrx component (#27549) 2019-10-12 12:37:59 -07:00
Franck Nijhof 445c741b30 Use literal string interpolation in integrations R-S (f-strings) (#26392) 2019-09-03 21:14:39 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07: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