Commit Graph

1686 Commits (70aeaa3c76a7e67dfbae3deb01105db9050bbdd3)

Author SHA1 Message Date
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
Erik Montnemery 1746677b61
Clarify duration selector (#68731) 2022-03-28 09:28:32 +02:00
Jan Bouwhuis cfc8b5fee7
Fix notify discovery setup (#68451)
* Fix notify discovery setup

* add test

* unsubscribe at reset

* Add guard

* move dispatcher to reload module

* only unsubscribe if platform was setup

* initialize dispatcher once and tests

* test get_service too

* add tests

* fix test

* use get_service for test invalid platform

* Test built-in reload method

* set to None after clearing dispatcher - tests

* Pathing services file

* Update tests/components/notify/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* dispatcher is not set twice if integration loaded

* empty discovery payload

* Removed not needed services.yaml mock

* Update tests/components/notify/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* flake8

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-28 08:53:30 +02:00
Erik Montnemery 0899b67578
Update selectors with frontend changes (#68623) 2022-03-26 21:41:39 -07:00
Franck Nijhof a2a612c640
Add enable_day to duration selector (#68705) 2022-03-26 21:31:22 -07:00
Marc Mueller 911b159281
Cleanup after pylint update (#68657) 2022-03-26 00:34:12 +01:00
Marc Mueller 53245c6523
Update pylint to 2.13.0 (#68656) 2022-03-25 15:14:48 -07:00
Erik Montnemery 76103752b8
Only show light group all option in advanced mode (#68610) 2022-03-24 16:51:31 +01:00
Erik Montnemery 3068c9c9d3
Sort selectors alphabetically (#68612) 2022-03-24 13:20:16 +01:00
Erik Montnemery c44d7205cf
Rename HelperFlowStep to HelperFlowFormStep (#68583) 2022-03-23 14:43:11 -07:00
Erik Montnemery a50bac5cc2
Make initial group config flow step a menu (#68565) 2022-03-23 08:34:44 -07:00
Martin Hjelmare 04843a975e
Improve reload helper typing (#68558) 2022-03-23 12:10:42 +01:00
Erik Montnemery eb068bc850
Fix targeting all or none entities in service calls (#68513)
* Fix targeting all or none entities in service calls

* Add test
2022-03-22 19:45:27 +02:00
Erik Montnemery 1b955970f8
Allow hiding and unhiding group members (#68192) 2022-03-22 12:14:34 +01:00
Erik Montnemery b5d2c6e43a
Add config flow for threshold binary sensor (#68238)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-22 11:32:19 +01:00
Marc Mueller 830cc278d3
Improve `CoordinatorEntity` typing (#68441) 2022-03-21 10:22:30 +01:00
Paulus Schoutsen 929df2bc29
Improve error handling process_play_media_url (#68322) 2022-03-20 20:25:15 -07:00
Paulus Schoutsen 8bbbd1947d
Raise if referenced entity does not support service (#68394) 2022-03-20 16:01:58 -07:00
Paulus Schoutsen a91888a7f8
Don't use hass.helpers (#68393) 2022-03-19 11:39:32 -10:00
Erik Montnemery d7145095ef
Tweak selectors (#68267)
* Optionally don't convert output of duration and time selectors

* Allow number selector selection to be None

* Never convert output of duration and time selectors

* Revert "Allow number selector selection to be None"

This reverts commit b6f52c1e83.
2022-03-18 10:26:05 +01:00
Paulus Schoutsen ad1e43e083
Add support for variables on trigger (#68275) 2022-03-18 09:25:22 +01:00
Marc Mueller eae0c75620
Make TypeVars private (2) (#68206) 2022-03-17 19:09:55 +01:00
Paulus Schoutsen f6af93ae35
Add support for menu step (#68203) 2022-03-16 14:14:50 -07:00
Erik Montnemery 46f27fdefd
Don't prevent automations from triggering themselves (#68178) 2022-03-15 18:48:54 +01:00
Erik Montnemery 34eb4aa2d0
Exclude hidden entities from targets (#68149) 2022-03-15 08:42:22 -07:00
Erik Montnemery 8ea31cea3a
Fix deadlock when stopping queued script (#68175) 2022-03-15 08:29:04 -07:00
Erik Montnemery 1a27025793
Prevent spawning script runs when shutting down (#68170) 2022-03-15 12:46:58 +01:00
Marc Mueller 376ac1bd83
Don't import TypeVars from core modules (#68154) 2022-03-15 09:30:55 +01:00
Erik Montnemery 314175135f
Hide switch_as_x tracked entity (#67949)
* Hide switch_as_x tracked entity

* Hide wrapped switch during config flow

* Allow setting/getting entity disabled by via WS

* Adjust tests

* Improve test coverage

* Improve tests
2022-03-14 19:39:07 +01:00
Marc Mueller 41df798375
Bump mypy to 0.940 (#68007) 2022-03-11 15:57:38 -08:00
Erik Montnemery 65fbcfa0ba
Prevent recursive script calls from deadlocking (#67861)
* Prevent recursive script calls from deadlocking

* Address review comments, improve tests

* Tweak comment
2022-03-10 19:28:00 +01:00
Erik Montnemery ee38dbd698
Add helper to set name of helper config entries (#67950) 2022-03-10 16:18:26 +01:00
Erik Montnemery 4e7d4db7ae
Align selectors with frontend updates (#67906)
* Align selectors with frontend updates

* Drop metadata from MediaSelector selection

* Adjust blueprint tests

* Address review comments

* Add tests for new selectors

* Don't stringify input

* Require min+max for number selector in slider mode

* vol.Schema does not like static methods

* Tweak
2022-03-10 16:17:59 +01: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
Erik Montnemery e7fba46a06
Refactor helper_config_entry_flow (#67895) 2022-03-09 13:18:19 +01:00
J. Nick Koston a75bbc79a2
Prevent polling from recreating an entity after removal (#67750) 2022-03-07 20:42:16 -08:00
Erik Montnemery a9cc2d2322
Add config flow for cover, fan, light and media_player groups (#67660)
* Add options flow support to HelperConfigFlowHandler

* Add config flow for cover, fan, light and media_player groups

* Update according to review comments

* Update translation strings

* Update translation strings

* Copy schema before adding suggested values
2022-03-07 13:05:04 +01:00
Erik Montnemery 0c12914548
Add config flow for switch.light (#67447)
* Add config flow for switch.light

* Refactor according to code review

* Setup light switch from config entry

* Improve async_resolve_entity

* Prepare for multiple steps

* Remove name and options flow from switch light

* Check type before adding description to schema keys

* Remove options flow enabler

* Copy name from the switch

* Move helper flows to new file

* Improve test coverage

* Fix name

* Remove dead code from abstract method

* Remove manifest 'helper' option

* Validate registry entry id before forwarding to light platform

* Improve test

* Add translations

* Improve config entry setup

* Log when config entry fails setup

* Update homeassistant/components/switch/__init__.py

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

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-04 20:02:17 +01:00
Erik Montnemery cd25769667
Rename async_resolve_entity_ids to async_validate_entity_ids (#67603) 2022-03-04 09:51:53 +01:00
Richard T. Schaefer 15580281a3
Allow area, device, and entity selectors to optionally support multiple selections like target selector (#63138)
* Allow area, device, and entity selectors to optionally support multiple selections like target selector

* Update according to code review comments

* Adjust tests

* Update according to review comments

* Tweak error message for multiple entities

Co-authored-by: Erik <erik@montnemery.com>
2022-03-03 10:35:06 +01:00
Mike Degatano 4ea6ca7f91
Prefer internal docker URL for VLC telnet when possible (#67090) 2022-03-01 21:56:20 -08:00
Paulus Schoutsen 65eefcacfc
Add support for detecting hostname based addresses as internal (#67407) 2022-03-01 16:56:05 -08:00
Marc Mueller ec980a574b
Improve typing [util.decorator] (#67087) 2022-02-23 20:58:42 +01:00
Franck Nijhof 3afadf8adb
Revert "Block peer certs on supervisor" (#67104) 2022-02-23 12:32:07 +01:00
Paulus Schoutsen 938b64081b
Block peer certs on supervisor (#66837)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-02-22 13:59:40 -08:00
Paulus Schoutsen 756e711850
Add a new validate config WS command (#67057) 2022-02-22 22:28:37 +01:00
Paulus Schoutsen c2e62e4d9f
Re-org device automations (#67064)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-02-22 13:15:16 -08:00
Erik Montnemery ec67dcb620
Add support for validating and serializing selectors (#66565)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-18 14:24:08 -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
Joakim Sørensen 0ac9376ee4
Add list to async_delay_save typing (#66795) 2022-02-18 11:07:14 +01:00
Marc Mueller 1a247f7d1b
Improve `device_automation` typing (#66621) 2022-02-17 22:08:43 +01:00
Bram Kragten ef34f070ee
Allow metadata in service call data (#66672)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
2022-02-16 21:13:36 +01:00
Erik Montnemery dcb3fc49c9
Include changes in EVENT_DEVICE_REGISTRY_UPDATED (#66641) 2022-02-16 12:29:08 +01:00
Marc Mueller 3b3e12aaa2
Fix `translation` typing (#66516) 2022-02-14 09:23:12 -08:00
Marc Mueller 94cfc89df9
Improve `DiscoveryFlowHandler` typing (#66511) 2022-02-14 15:28:52 +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
Erik Montnemery d40a830b89
Remove entities when config entry is removed from device (#66385)
* Remove entities when config entry is removed from device

* Update tests/helpers/test_entity_registry.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Don't remove entities not connected to a config entry

* Update homeassistant/helpers/entity_registry.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-02-13 17:23:30 +01:00
Joakim Sørensen 7a40ae13a4
Add guard for invalid EntityCategory value (#66316) 2022-02-11 14:57:45 +01:00
Kevin Stillhammer a0119f7ed0
Resolve zones and return state in find_coordinates (#66081) 2022-02-09 10:43:20 +01:00
Paulus Schoutsen 716a1e2a64
Add camera media source (#65977) 2022-02-08 14:32:02 -08: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
Erik Montnemery 009b31941a
Support restoring SensorEntity native_value (#66068) 2022-02-08 14:00:26 -08:00
Paulus Schoutsen 95a890c6e1
Get_url to prefer external URL if SSL configured (#66039) 2022-02-07 15:44:02 -08:00
Franck Nijhof fa09cf663e
Update black to 22.1.0 (#65788) 2022-02-05 14:19:37 +01:00
Paulus Schoutsen a6caf3f579
Call out 3rd party containers more clearly (#65684) 2022-02-04 09:57:14 -08:00
mk-maddin efb6fd1569
Fix script / automation repeat with count 0 fails (#65448)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-02-03 08:18:58 -08:00
w35l3y 076faaa4a4
Add support to reprompt user (#65256) 2022-01-31 10:23:26 -08:00
Erik Montnemery 94288886c3
Abort webhook flow when not connected to home assistant cloud (#64963) 2022-01-26 10:57:45 -08:00
Marc Mueller 5e633498d2
Enable `no_implicit_reexport` for core files [mypy] (#63820) 2022-01-26 10:55:06 +01:00
Erik Montnemery 037621b796
Update _TrackStateChangeFiltered entity listener with new entities (#64909) 2022-01-25 18:19:12 +01: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 3a09090a4b
Drop use of deprecated ENTITY_CATEGORIES (#64607)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-24 13:36:42 +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
J. Nick Koston 2083f0b3c0
Add support for checking if an entity is explicitly included in an entity filter (#64463) 2022-01-19 22:38:48 -08:00
Erik Montnemery a8c14835b9
Add entity options to entity registry (#64350)
* Initial commit for entity options

* Tweak broadlink tests

* Add async_update_entity_options + test
2022-01-18 22:47:46 +01:00
Erik Montnemery b3421cf727
Remove Windows workarounds (#64068) 2022-01-13 20:41:11 +01:00
epenet 128256a3ee
Fix invalid type hint in discovery async_listen (#63987)
* Fix invalid type hint in discovery async_listen

* Add setup type hints to sabnzbd

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-13 02:43:43 +01:00
Marc Mueller 8460c2f66d
Improve typing [helpers.entity_registry] (#63767) 2022-01-12 14:00:22 +01:00
Marc Mueller 12757a8cd2
Update typing - collections.abc (1) (#63933)
* Update typing - collections.abc (1)

* Additional typing updates
2022-01-12 07:56:35 +01:00
Stefan Agner 42706f780c
Convert disabled_by to DeviceEntryDisabler on load (#63944)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-01-11 20:50:32 -08:00
Marc Mueller 240c9979c7
Move `disallow-any-generics` to mypy.ini (#63917) 2022-01-11 13:33:25 -08:00
Marc Mueller d3b7bd25ef
Update typing (1) (#63922) 2022-01-11 21:26:03 +01:00
epenet 4eae888546
Fix incorrect type hint in config_per_platform helper (#63890)
* Adjust base helper

* Filter type is not None in mailbox

* Filter empty platforms in device_tracker

* Filter out empty platform in notify

* Filter out empty platform in entity_component

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-11 17:28:37 +01:00
Marc Mueller 021debb5c5
Resolve implicit imports (#63832) 2022-01-10 17:10:46 +01:00
Marc Mueller 01baa20671
Fix implicit reexport [dt_util] (#63829) 2022-01-10 16:31:23 +01:00
Petro31 9c6c13a55c
Add is_number as a test for use in select, selectattr, reject, and re… (#63732) 2022-01-10 13:00:43 +01:00
epenet 51292cc135
Fix incorrect type hint in discovery helper (#63789)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-10 11:14:31 +01:00
epenet 665eeb4b27
Explicitely allow Platform enum in discovery helper (#63571)
* Adjust Platform type hint in discovery helper

* Adjust amcrest

* Adjust comfoconnect

* Adjust ecovacs

* Adjust egardia

* Rename arguments

* Convert Platform enum to string explicitely

* Revert "Adjust egardia"

This reverts commit ff7b0d6100.

* Revert "Adjust ecovacs"

This reverts commit 2749045e13.

* Revert "Adjust comfoconnect"

This reverts commit bfff08f7fc.

* Undo argument name change and conversion to string

* Remove comment

Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-09 06:06:56 +01:00
Marc Mueller eb2238a9e1
Add types for HassJob [helpers.event] (#63675) 2022-01-08 14:26:22 +01:00
Erik Montnemery fc2025509e
Teach call service script action about entity registry ids (#61172) 2022-01-07 08:42:47 -08:00
Marc Mueller 54cb1e7556
Add strict typing to `core.py` (5) - Task (#63243) 2022-01-07 16:48:34 +01:00
Marc Mueller 250af90acb
Improve callable typing [helpers.event] (#63543) 2022-01-06 21:01:27 -10:00
Marc Mueller 198ade5e2b
Fix typing `TrackTemplateResultListener` [helpers.event] (#63541) 2022-01-06 13:43:54 -10:00
Erik Montnemery 6d57dbde68
Support passing callbacks to start.async_at_start (#63473)
* Support passing callbacks to start.async_at_start

* Update homeassistant/helpers/start.py

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Fix imports

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-05 18:04:09 +01:00
Marc Mueller 40262c4763
Fix exception import locations (#63454) 2022-01-05 15:00:49 +01:00
Marc Mueller c384596899
Use SensorDeviceClass in `sensor` and `helpers` packages (#63452) 2022-01-05 14:59:51 +01:00
Marc Mueller b0f72f59da
Use imports from `core` (#63458) 2022-01-05 14:55:38 +01:00
Paulus Schoutsen 2b4bb49eb7
Make device tracker entities work better (#63328)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-04 23:16:43 -08:00
Marc Mueller 3a32fe9a34
Add strict typing to `core.py` (2) - State (#63240) 2022-01-04 18:33:56 +01:00
Marc Mueller fcd80b2ed7
Fix `ensure_list` typing (#63311) 2022-01-04 15:23:48 +01:00
Ville Skyttä 5231bc5dcb
Simplify device registry update (#62868) 2022-01-04 15:02:11 +01:00
avee87 04606f05a4
Use built-in Jinja min and max filters in templates (#60327)
* Use built-in Jinja min and max filters in templates

* use built-in filter for global

* lint

* less generic name

* more tests

* even more tests
2022-01-04 10:07:23 +01:00
epenet 9971831b51
Improve typing in core service registration (#63005)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-30 21:18:10 +01:00
Tobias Sauerwein 2c904c0974
Bump mypy to 0.930 (#62642)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2021-12-27 17:55:17 +01:00
Ruslan Sayfutdinov 55f4962c06
Fix pylint plugin which checks relative imports (#62693) 2021-12-23 11:14:47 -08:00
Erik Montnemery cb2c2d98c3
Remove unnecessary checks before calling os.makedirs (#62576) 2021-12-23 09:59:31 +01:00
Franck Nijhof 07e034c1c6
Add iif (immediate if) template function/filter (#61428) 2021-12-21 17:25:07 +01:00