Commit graph

46 commits

Author SHA1 Message Date
Daniel Rozycki
04b0760e27
Skip NextBus update if integration is still loading (#123564)
* Skip NextBus update if integration is still loading

Fixes a race between the loading thread and
update thread leading to an unrecoverable error

* Use async_at_started

* Use local copy of _route_stops to avoid NextBus race condition

* Update homeassistant/components/nextbus/coordinator.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-18 14:24:44 +02:00
Ian
6406065e1f
Bump py-nextbusnext to 2.0.4 (#123750) 2024-08-13 08:51:41 +02:00
Ian
3e8d3083ac
Refactor NextBus integration to use new API (#121133)
* Refactor NextBus integration to use new API

This removes the `messages`, `directions`, and `attribution` attributes
from the sensor. Those may be added back in the future with additional
refactoring.

Some existing sensors may be broken today because of deprecated Agency
names. This patch will not migrate them as the migration path is
ambiguous. Setting up again should work though.

* Move result indexing outside of try/except
2024-07-24 18:18:21 +02:00
Sid
9bf87329da
Enable Ruff FLY002 rule (#115112)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-12 09:04:16 +02:00
Joost Lekkerkerker
763df83cdb
Remove Nextbus YAML import (#115277) 2024-04-09 18:34:35 +02:00
Sid
6587ee20db
Enable Ruff TRY300 (#114437)
* Enable Ruff TRY300

* Update validation.py

* Address review comments
2024-03-30 10:37:59 +01:00
Marc Mueller
aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller
988c71ecc5
Add empty line after module docstring [n-q] (#112702) 2024-03-08 15:04:07 +01:00
Joost Lekkerkerker
895dc6fce1
Add icon translations to Nextbus (#111981) 2024-03-03 14:08:19 +01:00
Erik Montnemery
e0c1feb22c
Migrate integrations n-r to generic flowhandler (#111864) 2024-02-29 20:09:01 +01:00
Joost Lekkerkerker
a82410d5e9
Deduplicate constants E-Z (#105657) 2023-12-13 17:05:37 +01:00
Ian
51c3a5d11d
Nextbus: Listify directions (#103337)
When a single value is returned, the list wrapper is not present in the
json payload. This patch ensures that the result is always a list.
2023-11-04 08:56:27 +01:00
Ian
c1d979dc07
Bump py_nextbusnext to v1.0.2 to fix TypeError (#103214)
* Bump py_nextbusnext to v1.0.1 to fix TypeError

Currently throwing an error as a set is passed into the method that is currently
expecting a Sequence. That method is technically compatible with Iterable, so the
latest patch relaxes that restriction.

* Bump version to v1.0.2 to fix error message
2023-11-03 17:03:02 +01:00
Ian
fe316f2233
Fix key error in config flow when duplicate stop names exist (#101491) 2023-10-05 22:11:15 +02:00
Ian
e652d37f29
Use data update coordinator in NextBus to reduce api calls (#100602) 2023-10-02 10:56:10 +02:00
Ian
c3f74ae022
Add config-flow to NextBus (#92149) 2023-09-19 17:10:29 +02:00
Ian
4b4660994c
Use shorthand attributes in NextBus (#94084)
* NextBus: Use attr with unique id

* Feedback

* Remove unique id
2023-06-06 07:08:42 +02:00
J. Nick Koston
7995d3777a
Fix package names to match pypi index metadata (#93883)
* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* Fix package names to match pypi index metadata

* uses _

* uses -

* fix metadata
2023-05-31 21:12:53 -04:00
Ian
0fcf8f968b
Move nextbus constants and utils (#92211)
* NextBus: Move general components to const and util

* Remove not yet used code
2023-05-11 17:28:29 +01:00
Ian
1f2da1217b
NextBus: Correct iot_class (#92208) 2023-04-29 21:41:35 +02:00
Erik Montnemery
1450b44c63
Sort manifests 7 (#87028) 2023-02-08 20:32:43 +01:00
Marc Mueller
63d519c1a8
Spelling updates (#82867) 2022-11-28 16:51:43 +01:00
epenet
420733a064
Improve entity type hints [n] (#77824) 2022-09-05 07:53:55 -05:00
J. Nick Koston
5b755b74fb
Add loggers to integration manifest.json (#65083) 2022-01-28 13:37:53 -08:00
epenet
80b6195505
Add sensor setup type hints [m-n] (#63314)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 19:09:36 +01:00
Ian
a6cfbd4072
Nextbus upcoming sort as integer (#61416) 2021-12-17 09:39:55 +01:00
epenet
81ea811b74
Use new enums in nextbus (#61954) 2021-12-16 22:44:17 +01:00
Paulus Schoutsen
ea42384afd
Fix nextbus timestamp sensor (#61212) 2021-12-07 22:23:14 -08:00
Erik Montnemery
103e21c278
Move temperature conversions to sensor base class (5/8) (#54475) 2021-08-12 13:26:17 +02:00
Ian
b930e17d64
Bump py-nextbusnext to 0.1.5 (#53924)
* NextBus: Rebrand and bump new version of py-nextbusnext

* Revert rebrand
2021-08-05 18:47:23 +02:00
Franck Nijhof
fcdd8b11a6
Collection of changing entity properties to class attributes - 2 (#51345) 2021-06-01 12:43:55 -07:00
Franck Nijhof
055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02:00
Erik Montnemery
c900e3030b
Migrate integrations n-q to extend SensorEntity (#48214) 2021-03-22 19:46:46 +01:00
Erik Montnemery
14a59d290a
Update integrations j-o to override extra_state_attributes() (#47758) 2021-03-11 20:11:25 +01:00
Franck Nijhof
187b6525b4
Removal of extraneous parenthesis (#33637) 2020-04-04 20:08:55 +02:00
Paulus Schoutsen
f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Franck Nijhof
a84741392b
Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
Ian
4f1f4a1b4f Nextbus: Sort results for upcoming times (#29811)
Sort upcoming times across all direction's for a particular route and
stop.
2019-12-10 09:22:13 +01:00
springstan
20fdcbadff Move imports to top for nextbus (#29520)
* Move imports to top for nextbus

* Fix test_sensor.py failed tests
2019-12-05 21:56:42 +01:00
Grodesh
f8712b4d7f Update nextbus stop tag to accept strings (#27765) 2019-11-06 07:24:11 +01:00
Franck Nijhof
c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Ian
12f68af107 Switch py_nextbus to py_nextbusnext (#26681)
The orignal package maintainer seems to be unresponsive. I've forked
the package and added the bug fixes to the new fork

Fixes #24561
2019-09-17 17:53:12 +02:00
Franck Nijhof
1c5e0123c9 Use literal string interpolation in integrations N-Q (f-strings) (#26391) 2019-09-03 11:35:00 -07:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
nierob
979f801488 Avoid creating temporary lists (#25317)
That gives nano performance improvements as *() is slightly faster
then *[].
2019-07-19 13:36:18 -07:00
Ian
c2e7445271 Add new nextbus sensor (#20197)
* Added new nextbus sensor

* Fix order in requirements_all after merge

* Add more flexible parsing of JSON lists

* Undo tox change
2019-04-26 19:51:58 -05:00