Commit Graph

1594 Commits (2f9beb4a4a3bc4269a2c08801d6716756c11bdb3)

Author SHA1 Message Date
Marc Mueller 283c04e424
Improve typing [helpers.entity] (#70890) 2022-04-28 10:52:42 +02:00
Marc Mueller 93cbb331e5
Update Mypy to 0.950 (#70948)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-27 20:49:54 -05:00
Marc Mueller 964c764dae
Improve typing [helpers.sun] (#70892) 2022-04-27 17:19:46 +02:00
Marc Mueller 7dfe8591c4
Improve typing [helpers.event] (#70891) 2022-04-27 17:19:06 +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
Marc Mueller 97af164858
Prepare for upcoming mypy update (#70800) 2022-04-26 07:41:52 -07:00
Paulus Schoutsen 5317bf02e6
Fix hidden default (#70699) 2022-04-25 10:10:42 -07:00
Erik Montnemery f6d9c75476
Remove metadata from device conditions and triggers (#70695) 2022-04-25 09:48:24 -07:00
Marc Mueller 9b9b553521
Disable no-self-use [pylint] (#70641)
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Dave T 70e125850c
Limit autogenerated entity_id string length (#69739) 2022-04-21 22:39:51 -07:00
Franck Nijhof 7b75a16745
Add visible by default property to base Entity (#70370) 2022-04-21 22:06:34 -07:00
Marc Mueller 90dab235f7
Update pylint to 2.13.7 (#70381)
* Update pylint to 2.13.7

* Spelling

* Remove old pylint config value

* Code updates
2022-04-21 13:02:52 -07:00
Franck Nijhof 35687def02
Merge stop & error script actions (#70109) 2022-04-20 14:22:37 -07:00
Erik Montnemery 64381acbaf
Mark device actions from hidden or auxiliary entities as secondary (#70278) 2022-04-20 10:48:46 -07:00
akloeckner d20a620590
Make `this` variable available in template entities (#65201)
* feat: make this variable available in template entities

This makes the variable `this` available in template entities.
It will simplify the use of self-referencing template entities.
Because, without this, we have to repeat the entity id every time.
If we can solve this without explicitly spelling the entity id,
code can be re-used much better.

As a side-effect, this will allow to use `variables`-like patterns,
where attributes can be used as variables to calculate subsequent attributes or state.

Example:
```yaml
template:
  sensor:
    - name: test
      state: "{{ this.attributes.test }}"
      # not: "{{ state_attr('sensor.test', 'test' }}"
      attributes:
        test: "{{ now() }}"
```

* expose entity_id instead of this

* add test

* Refactor to expose this variable

* Tweak repr dunder

Co-authored-by: Erik <erik@montnemery.com>
2022-04-20 15:30:17 +02:00
Thomas Lovén b50f369fe4
Add shorthand notation for boolean conditions (#70120) 2022-04-18 22:09:09 +02:00
Franck Nijhof ce1f074ca9
Add Template selector (#70229) 2022-04-18 11:28:01 -07:00
J. Nick Koston 026e1635cc
Rename async_process_integration_platform to async_process_integration_platform_for_component (#70217) 2022-04-17 20:59:31 -10:00
J. Nick Koston b4ef150339
Add a guard when there are no integration platforms loaded (#70182) 2022-04-17 22:45:52 -07:00
J. Nick Koston c393622b64
Avoid calling time.monotonic on coordinator refresh unless we are debugging (#70209) 2022-04-17 22:40:44 -07:00
J. Nick Koston 42c448c422
Add the ability to process integration platforms on demand (#70174) 2022-04-17 00:23:00 -10:00
Raman Gupta 3bcd921a28
Add entity registry helper to update entity platform (#69162)
* Add entity registry helper to migrate entity to new platform

* Add additional assertion

* Add more properties to migration logic

* Change logic after thinking about erik's comments

* Require new_config_entry_id if entry.config_entry_id is not None

* Create private async_update_entity function that all update functions use

* Don't have special handling for entity ID missing in async_update_entity_platform

* fix docstring
2022-04-16 16:18:52 -04:00
Franck Nijhof 1b48d7eda1
Add for each item support to repeat action (#70093) 2022-04-15 19:10:25 +02:00
Franck Nijhof e04fef3c2d
Allow disabling specific triggers/actions/conditions (#70082) 2022-04-15 09:33:09 -07:00
Franck Nijhof cdabcce83a
Add ability to continue scripts/automations on error (#70004) 2022-04-14 13:43:14 -07:00
Franck Nijhof d704d4f853
Add parallel automation/script actions (#69903) 2022-04-13 13:07:44 -07:00
Marc Mueller e407960f68
Update pylint to 2.13.5 (#69989) 2022-04-13 18:36:05 +02:00
Franck Nijhof fb92fc6a8e
Trigger on not matching to/from states (#69760) 2022-04-12 14:18:23 -07:00
Erik Montnemery a9742cc445
Drop frontend metadata from entity service schemas (#69894) 2022-04-12 18:09:06 +02:00
Franck Nijhof 67b200a532
Add if/else automation/script action (#69811)
Co-authored-by: Erik <erik@montnemery.com>
2022-04-12 15:02:17 +02:00
Franck Nijhof 81d90b1bc7
Add stop/error script/automation action (#67340) 2022-04-11 14:22:22 -07:00
Franck Nijhof 7087020283
Allow any entity to match state condition (#69763) 2022-04-11 10:53:42 -07:00
Franck Nijhof 6524dd8fb7
Add support for expanding zones in templates (#69793) 2022-04-11 12:59:45 +02:00
Raman Gupta b325c112b4
Add SelectorType enum and TypedDicts for each selector's data (#68399)
* rebase off current

* rearrange

* Overload selector function

* Update/fix all selector references

* better typing?

* remove extra option

* move things around

* Switch to Sequence type to avoid ignoring mypy error

* Get rid of ...'s

* Improve typing to reduce number of ignores

* Remove all typing ignores

* Make config optional for selectors that don't need a config

* add missing unit prefixes

* Rename TypedDicts

* Update homeassistant/helpers/selector.py

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

* review feedback

* remove peta from integration integration

* Fix min_max

* Revert change to selector function

* Fix logic

* Add typing for selector classes

* Update selector.py

* Fix indent

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-04-11 09:20:56 +02:00
Franck Nijhof 287edf9ac0
Fix area name unchanged gets written (#69813) 2022-04-11 00:03:01 +03:00
J. Nick Koston fe6a4bfb1d
Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Erik Montnemery f4fb29200c
Allow empty config in discovery.async_load_platform (#69619) 2022-04-07 23:24:47 +02:00
Allen Porter c07100e519
Move Local OAuth http endpoint registration to auth component (#69507) 2022-04-06 22:34:31 -07:00
J. Nick Koston c2c6d12d73
Only fire device_registry_updated for suggested_area if the suggestion results in an area change (#69215) 2022-04-04 09:51:39 +02:00
Erik Montnemery ae9c2df691
Return unsubscribe callback from start.async_at_start (#69083)
* Return unsubscribe callback from start.async_at_start

* Update calling code
2022-04-01 23:34:36 +02: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
Paulus Schoutsen 5eb19b8a70
Enforce RegistryEntryDisabler enum (#69017)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-31 13:10:07 -07:00
Raman Gupta 6b2fe6cba9
Add support for new select selector properties (#68952)
* Add support for new select selector properties

* fix mode option

* Apply suggestions from code review

* Correct validation for empty options, update tests

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-03-31 11:28:49 +02:00
Erik Montnemery f9f360c64e
Rename helper_config_entry_flow to schema_config_entry_flow (#68924) 2022-03-30 14:36:47 -07:00
Erik Montnemery 9471e4d77c
Don't override temperature unit for sensors (#68910) 2022-03-30 10:15:00 -07:00
Erik Montnemery 2c92d19058
Exclude own entity from group entity selector (#68782) 2022-03-30 18:07:47 +02: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
Paulus Schoutsen 206ea9d237
Expand group lights/covers etc (#68875)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-30 10:11:09 +02:00