1
0
mirror of https://github.com/home-assistant/core.git synced 2025-06-02 20:27:14 +00:00

61 Commits

Author SHA1 Message Date
Tatham Oddie
fb56c5875a
Add device class for UPNP uptime sensor ()
Allows for easier conversion of time periods within HA natively
2024-09-20 12:04:24 +02:00
Steven Looman
ac9c08f52c
Add port mapping entry count sensor to upnp ()
Add port mapping entry count sensor
2024-07-04 09:07:41 +02:00
Steven Looman
559caf4179
Use eventing for some of the upnp sensors, instead of polling () 2024-06-29 12:11:22 -05:00
Michael
7f7d025b44
Store runtime data inside the config entry in Upnp ()
store runtime data inside the config entry
2024-05-07 22:05:04 +02:00
Marc Mueller
062cc4bfce
Add empty line after module docstring [t-v] () 2024-03-08 10:35:23 -05:00
Joost Lekkerkerker
f357e13e3d
Add icon translations to UPnP ()
* Add icon translations to UPnP

* Add icon translations to UPnP
2024-03-06 06:31:37 +01:00
Erik Montnemery
0c2485bc03
Freeze integration entity descriptions ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10:00
Joost Lekkerkerker
bfbdebd0f7
Add entity translations to uPnP () 2023-07-23 20:21:57 +02:00
Steven Looman
9a5ceb9ef8
Use default rounding/presentation mechanism for upnp () 2023-03-20 15:44:05 +01:00
Erik Montnemery
cc564026fa
Move EntityCategory to homeassistant.const ()
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Marc Mueller
bd9f03010f
Improve upnp typing () 2022-12-29 10:59:06 +01:00
epenet
fba13dcc90
Use UnitOfTime in integrations (t-z) () 2022-12-20 12:30:14 +01:00
epenet
69bc95a715
Use DATA_SIZE device class in integrations () 2022-12-13 10:17:56 +01:00
epenet
535aba10ee
Use DataRate unit and device class in integrations () 2022-12-10 11:41:44 +01:00
Steven Looman
d50795af2b
Move upnp derived sensors to library, be more robust about failing getting some data () 2022-10-26 14:34:44 -05:00
Paulus Schoutsen
525afb729c
Disable some upnp entities by default () 2022-08-25 23:45:27 +02:00
epenet
8260767e8f
Enable basic type checking in upnp ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-03-08 07:51:23 +01:00
Steven Looman
dbbb5655e5
Bump async-upnp-client to 0.25.0 ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-02-27 08:29:29 -10:00
kodsnutten
1548877e36
Fix unique_id of derived sent-sensors () 2021-11-03 10:21:54 +01:00
Steven Looman
b75f1b8951
Fix broken upnp derived sensors reporting b/s instead of kb/s () 2021-10-15 13:03:03 -07:00
Steven Looman
3825f80a2d
Fix upnp creating derived sensors () 2021-10-11 09:35:26 +02:00
Marc Mueller
42f586c585
Fix upnp add_entities ()
* Fix upnp add_entities

* Remove nesting level
2021-09-07 22:27:03 +02:00
ehendrix23
4310a7d814
Add upnp sensor for IP, Status, and Uptime ()
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-09-03 17:15:28 +02:00
ehendrix23
8bf79d61ee
Add upnp binary sensor for connectivity status ()
* New binary sensor for connectivity

* Add binary_sensor

* New binary sensor for connectivity

* Add binary_sensor

* Handle values returned as None

* Small text update for Uptime

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Updates based on review

* Update homeassistant/components/upnp/binary_sensor.py

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Further updates based on review

* Set device_class as a class atribute

* Create 1 combined data coordinator
and UpnpEntity class

* Updates on coordinator

* Update comment

* Fix in async_step_init for coordinator

* Add async_get_status to mocked device
and set times polled for each call seperately

* Updated to get device through coordinator
Check polling for each status call seperately

* Use collections.abc instead of Typing for Mapping

* Remove adding device to hass.data as coordinator
is now saved

* Removed setting _coordinator

* Added myself as codeowner

* Update type in __init__

* Removed attributes from binary sensor

* Fix async_unload_entry

* Add expected return value to is_on

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-08-17 20:23:41 +02:00
Erik Montnemery
94a264afaf
Move temperature conversions to entity base class (7/8) () 2021-08-11 18:57:50 +02:00
Milan Meulemans
29d72714f3
Replace dict with DeviceInfo ()
* Replace dict with DeviceInfo

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-02 00:37:19 +02:00
Ruslan Sayfutdinov
cbaeec2a4e
Use AddEntitiesCallback type, pt.2 () 2021-04-30 20:38:59 +02:00
jan iversen
6992e24263
Rename HomeAssistantType —> HomeAssistant, integrations t* - v* ()
* Integration vizio: HomeAssistantType -> HomeAssistant.

* Integration velbus: HomeAssistantType -> HomeAssistant.

* Integration vacuum: HomeAssistantType -> HomeAssistant.

* Integration upnp: HomeAssistantType -> HomeAssistant.

* Integration upcloud: HomeAssistantType -> HomeAssistant.

* Integration twinkly: HomeAssistantType -> HomeAssistant.

* Integration tts: HomeAssistantType -> HomeAssistant.

* Integration tradfri: HomeAssistantType -> HomeAssistant.

* Integration traccar: HomeAssistantType -> HomeAssistant.

* Integration tplink: HomeAssistantType -> HomeAssistant.
2021-04-22 10:53:57 -04:00
Paulus Schoutsen
a90d3a051f
prefer total_seconds over seconds () 2021-04-20 17:41:36 -07:00
Steven Looman
555f508b8c
Reinitialize upnp device on config change ()
* Store coordinator at Device

* Use DeviceUpdater to follow config/location changes

* Cleaning up

* Fix unit tests + review changes

* Don't test internals
2021-04-14 23:39:44 +02:00
Erik Montnemery
783b453bbe
Migrate integrations t-v to extend SensorEntity () 2021-03-22 19:47:44 +01:00
Marc Mueller
b67b9b94f9
Update typing 13 () 2021-03-18 14:43:52 +01:00
Steven Looman
efa339ca54
Allow upnp ignore SSDP-discoveries () 2021-02-20 16:26:17 -10:00
Steven Looman
25c5c6aec9
Refactoring upnp component () 2021-01-29 10:23:34 +01:00
springstan
92379ad8d2
Use list literal without using dict.keys() () 2020-10-30 09:19:13 -05:00
J. Nick Koston
225743a620
Update upnp to use CoordinatorEntity () 2020-08-30 18:17:41 +02:00
Steven Looman
c33f309d5f
Fix upnp error on unload_entry if device does not exist () 2020-08-05 02:24:42 +02:00
Ville Skyttä
c2a21fa496
Update coordinator improvements ()
* Make generic

* Add type info to bunch of uses

* Recognize requests exceptions

* Recognize urllib exceptions
2020-07-30 18:04:00 +03:00
Steven Looman
d974cd4606
Prevent upnp to use None values () 2020-06-22 16:39:57 -07:00
Steven Looman
48899c7a1c
Move upnp update_interval options flow () 2020-05-11 20:03:12 +02:00
Steven Looman
a97460d1ab
Make upnp update interval configurable ()
* Simplification of upnp component

* Make update interval configurable

* Description

* Require minimal value of 30

* Black

* Linting

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-09 21:52:08 -05:00
Steven Looman
dfc66b2018
Rewrite parts of upnp component ()
* Rewrite parts of upnp component

* Linting

* Add SCAN_INTERVAL

* Get values simultaneously

* Move to time related constants, as per 

* Linting

* Move constant KIBIBYTE to homeassistant.const

* Simplify code

* Fix tests for 

* Changes after review

* Update homeassistant/components/upnp/sensor.py

* Changes after review

* Formatting

* Formatting

* Use ST from discovery info to avoid swapping device_types if device advertises multiple versions

* Linting

* Requirements for upnp + dlna_dmr components

* Linting

* Regen requirements

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

* Formatting

* Linting

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-11 00:24:03 +02:00
Paulus Schoutsen
4ebbabcdd1
Unsub dispatcher when removing entity from hass ()
* Unsub dispatcher when removing entity from hass

* Update homeassistant/components/plaato/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/volvooncall/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-02 09:25:33 -07:00
Steven Looman
b6e69cd370
Add log message on timeout and update less often for upnp devices ()
* Catch asyncio.TimeoutError, show a proper message instead

* Throttle updates to max once per 30s

* Change code owner

* Fix CODEOWNERS + linting

* Warn on connection timeout
2020-03-15 18:18:15 +01:00
Ville Skyttä
496bd3dddf
Add and use more unit constants ()
* Add and use speed constants

* Add and use meter based volume and area constants

* Add and use more mass unit constants

* Add and use concentration unit constants

* Add and use watts per square meter constant

* Use more time constants

* Use more data constants
2020-02-24 17:52:14 -08:00
springstan
a85808e325
Add and use time related constants ()
* Add and use time related constants

* Sort time constants and reuse them in data rate constants

* Fix greeneyemonitor import

* Fix greeneyemonitor import V2

* Fix failing here_travel_time test

* Add TIME_MONTHS and TIME_YEARS

* Use TIME_MINUTES in opentherm_gw and isy994

* Add and use TIME_MILLISECONDS

* Change inconsistent ones

* Add TIME_MICROSECONDS and TIME_WEEKS

* Use constants in apcupsd and travisci

* Fix import error in upnp sensor.py

* Fix isy994 sensor.py using TIME_YEARS

* Fix dyson tests

* Use TIME_SECONDS in more places

* Use TIME_DAYS in google wifi
2020-02-23 22:09:24 +02:00
Paulus Schoutsen
e019280d94
Annotate more async functions correctly () 2020-02-14 10:00:22 -08:00
Phil Bruckner
260596d11b Fix upnp raw sensor state formatting when None () 2020-01-09 06:51:30 +01:00
Ville Skyttä
a12cf7211d Upgrade pydocstyle to 5.0.1 ()
* Upgrade pydocstyle to 5.0.1

http://www.pydocstyle.org/en/5.0.1/release_notes.html

* Pydocstyle and other docstring fixes
2019-12-10 23:25:06 +01:00
Ville Skyttä
d257fff9ce Use "kB" and "s" as UPnP/IGD units ()
For consistency with various existing components, and they're more
commonly used and compact than "kbyte" and "sec".
2019-12-06 23:24:11 +05:30