Commit Graph

228 Commits (a4f678e7c9364d1962f3911530d67ee82483f1fe)

Author SHA1 Message Date
Erik Montnemery deedbca46c
Mark unused sync toggle method from ToggleEntity as final (#72370) 2022-05-23 17:52:21 +02:00
Erik Montnemery 1aaf78ef99
Remove entity category system in favor of hidden_by (#68550) 2022-05-02 09:33:16 -07:00
Marc Mueller 283c04e424
Improve typing [helpers.entity] (#70890) 2022-04-28 10:52:42 +02:00
Erik Montnemery c5d69ab1b2
Handle removed entites in collection.sync_entity_lifecycle (#70759)
* Handle removed entites in collection.sync_entity_lifecycle

* Add comment
2022-04-27 08:05:00 -07:00
Paulus Schoutsen 5317bf02e6
Fix hidden default (#70699) 2022-04-25 10:10:42 -07:00
Franck Nijhof 7b75a16745
Add visible by default property to base Entity (#70370) 2022-04-21 22:06:34 -07:00
epenet 4c7e1fe060
Cleanup ENTITY_CATEGORIES_SCHEMA (#66549)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-04-01 09:40:43 -07:00
Paulus Schoutsen 130ca2213f
Enforce EntityCategory enum (#69015)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-31 15:04:33 -07:00
Erik Montnemery 69ee4cd978
Deprecate temperature conversion in base entity class (#68978)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-31 14:29:44 -07:00
Erik Montnemery 9471e4d77c
Don't override temperature unit for sensors (#68910) 2022-03-30 10:15:00 -07:00
Erik Montnemery 91f6e58e9a
Allow customizing unit for temperature and pressure sensors (#64366)
* Allow customizing unit for temperature and pressure sensors

* pylint

* Adjust google_wifi tests

* Address review comments and add tests

* Improve rounding when scaling

* Tweak rounding

* Further tweak rounding

* Allow setting entity options with config/entity_registry/update

* Address review comments

* Tweak tests

* Load custom unit when sensor is added

* Override async_internal_added_to_hass

* Adjust tests after rebase

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Address review comments

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-30 15:43:04 +02:00
J. Nick Koston aaeaed4117
Compatibility for "device_state_attributes" which was deprecated in 2021.4 has been removed (#67837)
* Small performance tweaks to _async_write_ha_state

- Only call self.available once per cycle

- Only call self.device_state_attributes once per update cycle

- Do not check for device_state_attributes if extra_state_attributes is not None

* drop backcompat

* remove prop
2022-03-09 21:39:43 +01:00
J. Nick Koston a75bbc79a2
Prevent polling from recreating an entity after removal (#67750) 2022-03-07 20:42:16 -08:00
Marc Mueller 30e2411761
Add type ignore error codes [last ones] (#66816) 2022-02-18 18:15:57 +01:00
Marc Mueller bfb1abd3a2
Add type ignore error codes [helpers] (#66776) 2022-02-18 11:31:37 +01:00
epenet 0a7b1dec7d
Adjust type hint in core add_job (#66503)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-02-14 11:13:10 +01:00
Joakim Sørensen 7a40ae13a4
Add guard for invalid EntityCategory value (#66316) 2022-02-11 14:57:45 +01:00
Erik Montnemery 911e488d48
Fix ENTITY_CATEGORIES_SCHEMA (#66108)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-08 14:00:53 -08:00
epenet f662e8669e
Address late review in entity registry (#64851)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-24 22:42:38 +01:00
epenet 32d5c8e8ac
Add type hint to RegistryEntry.entity_category (#64618)
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-24 12:51:11 +01:00
Franck Nijhof 176f03d4ac
Allow toggles (switches) state to be None (#64621) 2022-01-23 11:31:01 +01:00
Marc Mueller b0f72f59da
Use imports from `core` (#63458) 2022-01-05 14:55:38 +01:00
Ruslan Sayfutdinov 55f4962c06
Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
J. Nick Koston 04153c0075
Add hardware version to the device registry (#61650) 2021-12-16 05:16:19 -06:00
Franck Nijhof ffb4b4df96
Only report deprecated device_state_attributes once (#60980) 2021-12-04 13:37:42 +01:00
Marvin Wichmann 707fe67c00
Move StrEnum to homeassistant.backports and move Platform to homeassistant.const (#60880)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-03 09:31:17 +01:00
Franck Nijhof c28b45cd83
Migrate entity categories to StrEnum (#60720) 2021-12-01 13:54:36 +01:00
Ville Skyttä 7c6a72b086
Remove unneeded pylint disables (#60235) 2021-11-23 21:40:53 +01:00
Ville Skyttä 053c456199
Change device entry type to an StrEnum (#59940)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-11-22 18:14:15 +01:00
Erik Montnemery 49a27e12ad
Add support to entity registry for overriding device_class (#59985) 2021-11-22 08:38:06 -08:00
Erik Montnemery 1609c0cc2c
Sort some entity_registry code (#59876)
* Sort some entity_registry code

* Sort some more entity_registry code

* Tweak
2021-11-18 11:51:32 +01:00
Simone Chemelli 8a02d87a17
Removed deprecated "device_state_attributes" for Amberelectric (#59672)
* Removed deprecated "device_state_attributes"

* Cleanup

* Postpone removal

* log deprecation warning

* Update homeassistant/helpers/entity.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-11-16 16:11:46 +01:00
Paulus Schoutsen a122cbab61
Mobile app to update entity registry on re-register sensors (#58378)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-10-31 20:21:46 -07:00
Erik Montnemery a0a8b9db26
Add entity category 'system' (#58595)
* Add entity category 'hidden'

* Update cloud

* Update Google assistant

* Update Alexa

* Fix tests

* Add ENTITY_CATEGORIES constant

* Rename ENTITY_CATEGORY_HIDDEN to ENTITY_CATEGORY_SYSTEM

* Correct import in motioneye
2021-10-28 14:36:41 +02:00
Erik Montnemery 1eebe45154
Add support for entity categories to MQTT entities (#57656)
* Add support for entity categories to MQTT entities

* Improve test

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/mqtt/mixins.py

Co-authored-by: Paul Monigatti <paulmonigatti@users.noreply.github.com>

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paul Monigatti <paulmonigatti@users.noreply.github.com>
2021-10-15 14:28:30 +02:00
Erik Montnemery e27e4c3561
Add support for device configuration URL (#57539)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-14 11:16:56 -07:00
Erik Montnemery 4b3d423767
Add config and diagnostic entities (#57528)
* Add config entity concept

* Rename is_config_entity to entity_category

* Add test

* Add 'diagnostic' entity category
2021-10-14 10:04:26 +02:00
Erik Montnemery bdbedd0f06
Alphabetize parts of device registry code (#57532) 2021-10-12 12:08:59 +02:00
Franck Nijhof 13db867c1d
Move attribution attribute to Entity base class (#57492) 2021-10-11 23:15:32 +02:00
Erik Montnemery 6954614e62
Warn if total_increasing sensor has negative states (#56564) 2021-09-30 07:49:16 -07:00
Marc Mueller 7af67d34cf
Use assignment expressions 01 (#56394) 2021-09-18 13:31:35 -10:00
Marc Mueller 69e413ac1e
Update pylint to 2.10.1 (#54963)
* Update pylint to 2.10.0

* useless-suppression

* Consider-using-tuple

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Use dict.items()

* Add pylint disable

* Use pylint 2.10.1

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-08-21 10:41:23 +02:00
Erik Montnemery 4e07ab1b32
Move temperature conversions to sensor base class (1/8) (#48261)
* Move temperature conversions to entity base class (1/8)

* Update integrations a-c

* Leave old temperature conversion until all integrations are migrated

* tweak

* Use contextlib.suppress

* Remove the MeasurableUnitEntity mixin

* Address comments, add tests

* Fix f-string

* Drop deprecation warning from base entity class

* Update with _attr-shorthand

* Fix rebase mistakes

* Fix additional rebase mistakes

* Only report temperature conversion once

* Fix additional rebase mistakes

* Format homeassistant/components/bbox/sensor.py

* Fix check for overidden _attr_state

* Remove test workarounds from implementation

* Remove useless None-check

* Tweaks

* Migrate new sensors a-c

* Update climacell

* Push deprecation of temperature conversion forward

* Override __repr__ in SensorEntity

* Include native_value in SensorEntity attributes

* Pylint

* Black

* Black

* Fix rebase mistakes

* black

* Fix rebase mistakes

* Revert changes in august/sensor.py

* Revert handling of unit converted restored state

* Apply code review suggestion

* Fix arlo test
2021-08-11 10:45:05 +02:00
Allen Porter 160bd74bae
Update DeviceInfo static types (#54276)
* Update nest static types from aditional PR feedback

Update nest and device helper static types based on post-merge discussion in PR #53475

* Remove unused type: ignore in synology

* Remove check for None device type

Remove check for None device type in order to reduce untested code as this is
a case not allowed by the nest python library.
2021-08-08 19:24:36 -07:00
Franck Nijhof d4c4263730
Adjust typing of _attr_extra_state_attributes (#53529) 2021-07-27 01:25:22 +02:00
Franck Nijhof 0b44265232
Add description classes to entity components (#53521)
* Add description classes to entity components

* An -> A

* Add StateVacuumEntityDescription
2021-07-27 00:22:21 +02:00
Franck Nijhof ee452d415d
Add SensorEntityDescription class (#53357) 2021-07-26 22:00:43 +02:00
Aaron Bach 0fd88e7e66
Type _attr_extra_state_attributes as a MutableMapping (#52616)
* Type extra_state_attributes as a MutableMapping

* Update homeassistant/helpers/entity.py

Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>

* Update homeassistant/helpers/entity.py

Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>
2021-07-20 15:41:03 -06:00
Erik Montnemery b916247e8e
Improve editing of device automation referring non added select entity (#52047)
* Improve editing of device automation referring non added select entity

* Update tests
2021-06-21 14:49:51 +02:00
Erik Montnemery ba6b527d61
Improve editing of device actions referencing non-added HVAC (#51706)
* Improve editing of device actions referencing non-added HVAC

* Improve test coverage
2021-06-11 11:13:55 +02:00