Commit Graph

4 Commits (9f885a68ff7495fadc891122272223f166d2e3c7)

Author SHA1 Message Date
Martin Hjelmare 0aa489e3f0
Refactor tradfri switch tests (#86816)
Co-authored-by: Patrik Lindgren <21142447+ggravlingen@users.noreply.github.com>
2023-02-05 21:02:17 +01:00
Patrik Lindgren 4b5996c5ed
Drop support for Tradfri groups and YAML configuration (#68033)
* Drop support for Tradfri groups

* Remove context

* Remove async_setup

* Mark removed

* Pass generator expression
2022-04-01 23:26:35 +02:00
Patrik Lindgren 9d404b749a
Implement coordinator class for Tradfri integration (#64166)
* Initial commit coordinator

* More coordinator implementation

* More coordinator implementation

* Allow integration reload

* Move API calls to try/catch block

* Move back fixture

* Remove coordinator test file

* Ensure unchanged file

* Ensure unchanged conftest.py file

* Remove coordinator key check

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Import RequestError

* Move async_setup_platforms to end of setup_entry

* Remove centralised handling of device data and device controllers

* Remove platform_type argument

* Remove exception

* Remove the correct exception

* Refactor coordinator error handling

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove platform type from base class

* Remove timeout context manager

* Refactor exception callback

* Simplify starting device observation

* Update test

* Move observe start into update method

* Remove await self.coordinator.async_request_refresh()

* Refactor cover.py

* Uncomment const.py

* Add back extra_state_attributes

* Update homeassistant/components/tradfri/coordinator.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Refactor switch platform

* Expose switch state

* Refactor sensor platform

* Put back accidentally deleted code

* Add set_hub_available

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix tests for fan platform

* Update homeassistant/components/tradfri/base_class.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/tradfri/base_class.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix non-working tests

* Refresh sensor state

* Remove commented line

* Add group coordinator

* Add groups during setup

* Refactor light platform

* Fix tests

* Move outside of try...except

* Remove error handler

* Remove unneeded methods

* Update sensor

* Update .coveragerc

* Move signal

* Add signals for groups

* Fix signal

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-27 11:12:52 +01:00
Patrik Lindgren 03defdc922
Add test cases for Tradfri cover platform (#64072)
* Add test cases for Tradfri cover

* Simplify test

* Fix typo

* Fix typos

* Update tests/components/tradfri/test_cover.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix

* Remove unused function

* Move common tools to separate file

* Simplify parametrization

* Use int

* Remove loop

* Use context manager

* Simplify

* Update docstring

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-14 19:40:14 +01:00