Commit graph

22 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
Marc Mueller
add741d789
Update coordinator typing (6) [t-v] () 2022-03-21 14:20:35 +01:00
Martin Hjelmare
93247d7933
Use RequestError in tradfri () 2022-02-23 09:34:32 +01:00
Patrik Lindgren
543b49728a
Fix tradfri device name () 2022-02-10 08:19:59 +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
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
jan iversen
933ad5ae49
Fix tradfri group reachable access () 2021-11-06 16:46:51 +01:00
jan iversen
55534cfedd
When tradfri device goes offline set attr_available false () 2021-10-27 18:27:16 +02: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
epenet
176ed4f7ba
Use DeviceInfo on components with via_device (I-T) ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-22 12:31:12 +02:00
Marc Mueller
d51487f82a
Import Callable from collections.abc (3) () 2021-09-29 16:19:06 +02:00
jan iversen
93e9a67d7d
Make tradfri base_class.py strictly typed ()
* Make base_class.py strictly typed.
2021-09-20 14:33:50 +02:00
jan iversen
9b710cad5d
Add strict typing to tradfri __init__ and switch ()
* Add strict typing to __init__ and switch.

* Review comments.

* Review comments.

* Corrected switch.
2021-09-18 23:24:35 +02:00
jan iversen
0dd128af77
Change fix property to _attr for tradfri () 2021-09-06 08:49:00 +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
aaa1d06809
Directly call async_write_ha_state ()
* Directly call async_write_ha_state

* Address comments

* Fix tests
2020-04-01 14:19:51 -07:00
springstan
9fbb345ce0 Move imports to top for tradfri () 2019-11-30 21:23:39 -08: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
3454b6fa87 Refactor Tradfri base class ()
* Refactor Tradfri base class

* Clarify doc

* Fix pylint

* Review fix

* Move
2019-10-13 13:59:28 -07: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
Patrik
1059cea28f Refactor IKEA Tradfri, part 2 ()
* Add more device info data

* Add attributes to device_info

* Refactor sensor

* Filter
devices

* Update following review

* Update following review

* Add device_Class
2019-10-06 19:24:56 +02:00
Patrik
5ae497bfdc Refactor Tradfri switch device ()
* Refactor Tradfri switch device

* Lint

* Lint

* Removed unused constant

* Add base_class

* Lint

* Improvements after review

* Typo
2019-10-05 12:46:16 -07:00