Commit Graph

13 Commits (a4f678e7c9364d1962f3911530d67ee82483f1fe)

Author SHA1 Message Date
epenet 84221f656a
Add sensor setup type hints [c-d] (#63318)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 19:16:42 +01:00
Marc Mueller 4c68662612
Use assignment expressions 34 (#58823) 2021-10-31 19:01:16 +01: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
Franck Nijhof 38d095aa18
Define entity attributes as entity class variables (#50925)
* Define entity attributes as entity class variables

* Example coronavirus integration

* Example verisure

* Cleanup/typing fixes

* Fix Coronavirus

* Revert "Fix Coronavirus"

This reverts commit 060843860f.

* Revert "Cleanup/typing fixes"

This reverts commit 659b79e75a.

* Define entity attributes as entity class variables (attr alternative)

* Example coronavirus

* Example nut

* Example verisure

* Mark private

* Cleanup after all reverting/cherrypicking/merging

* Implement all entity properties

* Update coronavirus example

* Update nut example

* Update verisure example

* Lets not talk about this one...

* Fix multiple class attribute
2021-05-22 09:13:50 -07:00
Erik Montnemery 9e9ba53f0e
Move SensorEntity last in the inheritance tree (#48230) 2021-03-22 20:05:13 +01:00
Erik Montnemery e0cd7072d6
Migrate integrations a-c to extend SensorEntity (#48210) 2021-03-22 12:37:16 +01:00
Erik Montnemery 6c084ae6ce
Update integrations a-e to override extra_state_attributes() (#47756) 2021-03-11 16:51:03 +01:00
springstan e5b360cd08
Update coronavirus to use CoordinatorEntity (#39449)
* Update coronavirus to use CoordinatorEntity

* Remove should_poll from coronavirus
2020-08-30 13:04:01 -05:00
Martin Hjelmare 149a3165e6
Fix coronavirus worldwide sum (#36737)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 21:22:52 -07:00
brubaked 3910ab6cab
Changed Sensor icons to be more emotionally sensitive (#32904)
The existing sensor icons, while descriptive - dead = dead - are perhaps too matter of fact and don't accurately convey the tragedy. I changed emoticon-dead-outline to emoticon-cry-outline, as I think it better conveys the reality of the situation along with the emotions tied to the statistic.
2020-03-17 10:17:18 -07:00
Quentame 15a5cebd5f
Add icons to Coronavirus (#32480)
* Add icons to Coronavirus

* Update homeassistant/components/coronavirus/sensor.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-05 00:02:22 +01:00
Paulus Schoutsen fcbea47c74
Coronavirus updates (#32417)
* Sort countries alphabetically

* Update sensor name

* Add migration to stable unique IDs

* Update sensor.py
2020-03-02 17:59:32 -08:00
Paulus Schoutsen 1603f7ac21
Add coronavirus integration (#32413)
* Add coronavirus integration

* Update homeassistant/components/coronavirus/manifest.json

Co-Authored-By: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-03-02 13:40:11 -08:00