Commit graph

31 commits

Author SHA1 Message Date
Jan-Philipp Benecke
39e720caed
Use debug/warning instead of info log level in components [t] (#126147) 2024-09-18 12:39:50 +02:00
Maciej Bieniek
bc5849e4ef
Bump aiotractive to 0.6.0 (#121155)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-21 18:11:05 -05:00
Maciej Bieniek
cdcf091c9c
Pass the message as an exception argument in Tractive integration (#118534)
Pass the message as an exception argument

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-31 09:11:52 +02:00
Maciej Bieniek
9bd1c408bd
Raise ConfigEntryNotReady when there is no _id in the Tractive data (#118467)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-30 11:00:36 +02:00
Marc Mueller
44049c34f9
Use PEP 695 type alias for ConfigEntry types (#117632) 2024-05-17 15:42:58 +02:00
Maciej Bieniek
40be1424b5
Store Tractive data in config_entry.runtime_data (#116781)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-05-08 09:03:26 +02:00
Maciej Bieniek
c9c0625fa5
Adapt Tractive integration the latest API changes (#114380)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-03-28 13:25:01 +01:00
Marc Mueller
062cc4bfce
Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
Maciej Bieniek
a6f0b6a005
Ignore trackable without details in Tractive integration (#109814)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-06 22:36:12 +01:00
Maciej Bieniek
2d2e215e2c
Fix Tractive switch availability (#104502) 2023-11-28 12:08:12 +01:00
Maciej Bieniek
8e8f2a2163
Don't assume that the sleep value is a dictionary in Tractive integration (#103138)
* Sleep value can be null

* Catch TypeError
2023-11-04 18:08:06 +01:00
Maciej Bieniek
fe713cec8f
Don't assume that the activity/sleep labels are always present in Tractive event (#99197)
* Don't assume that the activity_label and sleep_labes are always present in an event

* Catch KeyError
2023-08-29 17:52:29 +02:00
Maciej Bieniek
66c10facfa
Add Tractive sleep and activity sensors (#98575)
* Add sleep and activity sensors

* Use device class ENUM

* Default value for value_fn
2023-08-19 11:48:23 +02:00
Maciej Bieniek
d44847bb23
Log Tractive events on debug level (#98539) 2023-08-17 17:09:16 +02:00
Maciej Bieniek
d6a7127b84
Improve availability of Tractive entities (#97091)
Co-authored-by: Robert Resch <robert@resch.dev>
2023-08-17 12:15:36 +02:00
Maciej Bieniek
79bcca2853
Add wellness sensors to Tractive integration (#96719)
* Add sleep sensors

* Add minutes rest sensor

* Add calories sensor

* Add state_class to entity descriptions
2023-07-17 09:02:42 +02:00
Franck Nijhof
8819634b61
String formatting and max line length - Part 6 (#84525) 2022-12-24 13:19:51 +01:00
Gleb Sinyavskiy
6c024c8875
Bump aiotractive, properly handle auth errors when reading events (#76715)
* Bump aiotractive, start handling authorzation errors when reading events

* Bump aiotractive, start handling authorzation errors when reading events

* Properly handle unauthorized errors

* Update homeassistant/components/tractive/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Use await when unsibscribing after auth error

* Update homeassistant/components/tractive/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-11-24 21:51:18 +01:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
Gleb Sinyavskiy
cf5f0a415c
Add tractive client_id, update aiotractive (#70807)
* Add client_id to Tractive

* Update aiotractive
2022-04-26 19:21:27 +03:00
Marc Mueller
fa7e787415
Update typing (3) [k-t] (#63924) 2022-01-11 21:26:55 +01:00
Marc Mueller
b79b35abb5
Use platform enum (7) [T-Z] (#60948)
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
Daniel Hjelseth Høyer
fbaec76b8a
Add more Tractive sensors (#55170)
* Tractive, add more sensors

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* source

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Fix unit for sensor

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Device state

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Device state

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tractive

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tractive

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* unit

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Handle unavailable

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* time

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* continue

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* remove sensor

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* style

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* tractive states

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2021-12-01 20:44:48 +01:00
Maciej Bieniek
946a265c9e
Use Final type only when needed in Tractive (#57000) 2021-10-03 22:12:59 +02:00
Maciej Bieniek
f3c76fb859
Add strict typing to Tractive integration (#56948)
* Strict typing

* Add few missing types

* Run hassfest

* Fix mypy errors

* Use List instead of list
2021-10-03 09:13:12 +02:00
Maciej Bieniek
0463007050
Add switch platform to Tractive integration (#55517) 2021-09-29 21:06:11 +02:00
Maciej Bieniek
2581a3a735
Add binary sensor platform to Tractive integration (#56635)
* Add binary sensor platform

* Update .coveragerc file

* Create battery charging sensor only if tracker supports it

* Improve async_setup_entry

* Add TRAXL1 model
2021-09-28 09:56:06 +02:00
Maciej Bieniek
e62c9d338e
Rework Tractive integration init (#55741)
* Rework integration init

* Suggested chancge

* Use Trackables class

* Use try..except for trackable_objects

* Check that the pet has tracker linked
2021-09-24 08:45:03 +02:00
Maciej Bieniek
09b872d51f
Add sensor platform for Tractive integration (#54143)
* Add sensor platform

* Add extra_state_attributes

* Add more constants

* Add sensor.py to .coveragerc file

* Use native value

* Suggested change

* Move SENSOR_TYPES to sensor platform

* Add domain as prefix to the signal

* Use TractiveEntity class

* Add model.py to .coveragerc file

* Clean up files

* Add entity_class attribute to TractiveSensorEntityDescription class

* TractiveEntity inherits from Entity

* Suggested change

* Define _attr_icon as class attribute

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
2021-08-24 00:20:28 +02:00
Daniel Hjelseth Høyer
d11c58dac8
Improve Tractive (#54532)
* Tractive, code improve

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tractive, code improve

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tractive, code improve

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Update homeassistant/components/tractive/config_flow.py

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

* Update homeassistant/components/tractive/const.py

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

* Tractive, comments

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Update homeassistant/components/tractive/config_flow.py

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

* Update homeassistant/components/tractive/config_flow.py

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

* Tractive

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Reauth

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Reauth

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* add tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* add tests

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-16 12:56:10 +02:00
Gleb Sinyavskiy
25eb27cb9f
Add tractive integration (#51002)
* Scaffold

* Implement config flow

* Add dymmy device tracker and TractiveClient

* Add simple DeviceTracker

* Add device info

* Listen to tractive event and update tracker entities accordingly

* Refactoring

* Fix logging level

* Handle connection errors

* Remove sleep

* Fix logging

* Remove unused strings

* Replace username config with email

* Update aiotractive

* Use debug instead of info

* Cover config_flow

* Update .coveragerc

* Add quality scale to manifest

* pylint

* Update aiotractive

* Do not emit SERVER_AVAILABLE, properly handle availability

* Use async_get_clientsession

Co-authored-by:  Daniel Hjelseth Høyer <mail@dahoiv.net>

* Add @Danielhiversen as a codeowner

* Remove the title from strings and translations

* Update homeassistant/components/tractive/__init__.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Force CI

* Use _attr style properties instead of methods

* Remove entry_type

* Remove quality scale

* Make pyupgrade happy

Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-08-05 12:47:42 +02:00