Commit graph

19 commits

Author SHA1 Message Date
Patrik Lindgren
04fc3a1f25
Cleanup constants in Tradfri integration ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-05 14:00:45 +02:00
Patrik Lindgren
4b5996c5ed
Drop support for Tradfri groups and YAML configuration ()
* 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
afd0005a31
Add sensor for filter time left on Tradfri fan platform ()
* Add support for filter time left

* Fix test for fan platform

* Remove debug code

* Add unique id migration tool

* Convert to hours

* Fix tests

* Apply suggestions from code review

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

* Add comment, check migration

* Refactor migration helper

* Refactor migration helper

* Move definition of new unique id

* Return after warning

* Add test for unique id migration

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-08 02:21:22 +01:00
Patrik Lindgren
9d404b749a
Implement coordinator class for Tradfri integration ()
* 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
b52a8ba37a
Bump pytradfri to 8.0.1 and fix fan preset mode "Auto" bug ()
* Move util functions

* Fix errors

* Revert changes

* Fix tests

* Use self.async_set_percentage()

* Fix calculation functions and associated tests

* Handle case of 0

* Update tests/components/tradfri/test_util.py

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

* Update tests/components/tradfri/test_util.py

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

* Update tests/components/tradfri/test_util.py

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

* Handle case of 0

* Update homeassistant/components/tradfri/fan.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-14 04:01:24 +01:00
Marc Mueller
b79b35abb5
Use platform enum (7) [T-Z] ()
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-12-04 14:10:01 +01:00
jan iversen
06d29040b9
Catch connection errors that makes tradfri hang in startup () 2021-11-09 13:00:50 +01:00
jan iversen
2b68b9292c
Set tradfri entities to non-available when hub is not available ()
* Set available when needed.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-08 18:41:25 +01:00
Patrik Lindgren
c950f1ccfa
Initial support for Tradfri STARKVIND Air purifier ()
* Initial commit

* Update homeassistant/components/tradfri/const.py

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

* Feedback

* Updates

* Remove logger

* Fix codestring

* Update homeassistant/components/tradfri/fan.py

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

* Update homeassistant/components/tradfri/fan.py

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

* Update homeassistant/components/tradfri/fan.py

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

* Percent value

* Add tests

* Typo

* Update tests

* Fix util function

* Update homeassistant/components/tradfri/fan.py

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

* Update after review

* Review

* Coverage

* Fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-25 08:15:46 +02:00
jan iversen
2d669a4613
Remove legacy code. () 2021-08-11 11:07:04 +02:00
Martin Hjelmare
b6630a48b2
Add tradfri api call error handling ()
Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-09-05 23:02:32 +02:00
Paulus Schoutsen
948ec80b6e
Bump pytradfri to 7.0.0, support multiple gateways ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-03 14:47:14 +02:00
Kris Bennett
f2fbe657c4
Add tradfri cover model to the cover entity attributes ()
* Ikea Blind Battery

* Ikea Blind Battery

* Ikea Blind Battery

* Ikea Blind Battery

* IKEA Blinds Battery

* IKEA Blinds Battery

* Update cover.py

* Clean up

* Remove unused import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2020-04-09 19:37:55 +02:00
springstan
9fbb345ce0 Move imports to top for tradfri () 2019-11-30 21:23:39 -08:00
Ville Skyttä
d88ca0f5cb Lint exclusions ()
* Remove malformed pylint disable markers

* Remove some unused imports

* Remove some unneeded lint exclusions

* Remove more unneeded lint exclusions

* Add specific codes to all noqa's
2019-11-16 10:22:07 +01:00
Patrik
86347a3d5f Refactor Tradfri light group ()
* Set same manufacturer name of gateway as of devices

* Refactor Tradfri light group

* Restore should_poll and async_update
2019-10-21 21:42:17 +02:00
Patrik
78e9bba279 Refactor Tradfri constants ()
* Refactor constants

* Rename constant

* Rename constant

* Rename constant

* Review update

* Remove duplicate constant

* Reorder constants

* Dont refresh features

* Order package imports

* Fix bug

* Put back features in refresh

* Fix import order

* Refactor supported features

* Refactor supported features, take 2
2019-10-09 12:56:16 -07:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen
a1c524d372
Config flow tradfri ()
* Fix comments

* Add config flow tests

* Fix Tradfri light tests

* Lint

* Remove import group from config flow

* fix stale comments
2018-09-19 21:21:43 +02:00