Compare commits

...

137 Commits

Author SHA1 Message Date
abmantis e729ac1ac5 Add override decorator to components A to B 2026-05-24 18:57:16 +01:00
G Johansson 92ce5ed75a Group sequential executor calls in yale_smart_alarm (#172065) 2026-05-24 18:21:27 +02:00
SeifEddineMezned 466e28eae2 worldclock: Remove name field from config flow (#169000)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-24 18:20:58 +02:00
J. Nick Koston d53a8c7df9 Bump aioshelly to 13.26.0 (#172049) 2026-05-24 17:53:17 +02:00
renovate[bot] 8fe26bdf59 Update fnv-hash-fast to 2.0.3 (#172003) 2026-05-24 10:22:02 -05:00
Max Michels f75d56c096 Remove unused duplicate constants in google_travel_time with homeassistant.const imports (#172045) 2026-05-24 17:01:45 +02:00
Max Michels 7e5942ae51 Remove unused duplicate constants in aurora_abb_powerone with homeassistant.const imports (#172047) 2026-05-24 17:01:22 +02:00
renovate[bot] f9ef9963e6 Update ulid-transform to 2.2.1 (#172004) 2026-05-24 10:00:58 -05:00
J. Nick Koston cea718528f Bump aioesphomeapi to 45.2.2 (#172043) 2026-05-24 16:57:09 +02:00
Max Michels 9c38868bbe Replace duplicate constants in victron_remote_monitoring with homeassistant.const imports (#172044) 2026-05-24 16:51:25 +02:00
J. Nick Koston 62da1c34fb Expose async_request_active_scan via the bluetooth API (#172010) 2026-05-24 10:44:49 -04:00
J. Nick Koston 2d3a3bf4fc Allow bluetooth coordinators to request an active scan cadence (#172015) 2026-05-24 10:43:52 -04:00
J. Nick Koston daa60c6d55 Bump habluetooth to 6.7.2 (#172042) 2026-05-24 09:40:31 -05:00
J. Nick Koston d45730aa02 Bump inkbird-ble to 1.2.2 (#172040) 2026-05-24 16:28:40 +02:00
Ron 05ef944766 Group sequential async_add_executor_job calls in fireservicerota (#171474) 2026-05-24 16:20:10 +02:00
J. Nick Koston a51daf48c7 Bump bluetooth-data-tools to 1.29.18 (#172017) 2026-05-24 15:35:44 +02:00
Simone Chemelli 6a789d5af7 Bump aiovodafone to 3.3.0 (#172036) 2026-05-24 15:07:47 +02:00
Glenn Waters ad4e218b69 UPB integration: bump lib to 0.7.2 (#171975) 2026-05-24 15:06:42 +02:00
Max Michels 55f576c784 Remove unused duplicate constants in tuya with homeassistant.const imports (#171971) 2026-05-24 12:12:11 +02:00
Max Michels c7c3988b11 Replace duplicate constants in color_extractor with homeassistant.const imports (#172032) 2026-05-24 12:10:36 +02:00
Max Michels ac825ca36d Replace duplicate constants in iperf3 with homeassistant.const imports (#171972) 2026-05-24 12:07:17 +02:00
Allen Porter 0b439a25e1 Bump ical to 13.2.4 (#172001) 2026-05-24 12:03:21 +02:00
Maciej Bieniek 0385e81010 Import ATTR_MODEL from homeassistant.const in BraviaTV (#171983) 2026-05-24 12:01:54 +02:00
Max Michels 699fed7a3a Replace duplicate constants in fujitsu_fglair with homeassistant.const imports (#172029) 2026-05-24 12:00:34 +02:00
Max Michels 0eefc8f327 Replace duplicate constants in drop_connect with homeassistant.const imports (#172031) 2026-05-24 11:59:32 +02:00
Max Michels 6888d203eb Replace duplicate constants in fish_audio with homeassistant.const imports (#172030) 2026-05-24 11:58:47 +02:00
Max Michels 359949adc2 Replace duplicate constants in growatt_server with homeassistant.const imports (#172027) 2026-05-24 11:34:00 +02:00
Maciej Bieniek afe7d0cbbf Bump gios to 7.1.0 (#171962) 2026-05-24 10:45:03 +02:00
Max Michels 2f7b3cb7d9 Replace duplicate constants in hegel with homeassistant.const imports (#171974) 2026-05-24 10:43:43 +02:00
Max Michels c49ed549db Replace duplicate constants in energyid with homeassistant.const imports (#171976) 2026-05-24 10:43:16 +02:00
Joakim Sørensen 3016198644 Add devcontainer-lock.json file (#171982) 2026-05-24 10:38:04 +02:00
Max Michels f0c9156cdb Replace duplicate constants in version with homeassistant.const imports (#171970) 2026-05-24 10:32:46 +02:00
Max Michels f091871aa5 Replace duplicate constants in zeroconf with homeassistant.const imports (#171968) 2026-05-24 10:31:54 +02:00
Max Michels d25207180a Replace duplicate constants in elevenlabs with homeassistant.const imports (#171977) 2026-05-24 10:31:28 +02:00
Max Michels 9ce047b9be Replace duplicate constants in tplink_omada with homeassistant.const imports (#171978) 2026-05-24 10:30:58 +02:00
Nick Kuiper 488c04fc5b Remove myself as code owner from blue_current integration (#171998) 2026-05-24 10:29:59 +02:00
Allen Porter 7598fdb8cb Fix exception translation placeholder mismatch in google_photos (#172012) 2026-05-24 10:29:28 +02:00
Penny Wood 49e22072c9 Bump python-izone to 1.2.10 (#172021) 2026-05-24 10:29:04 +02:00
J. Nick Koston c056242390 Bump habluetooth to 6.7.1 (#172000) 2026-05-24 08:52:21 +02:00
J. Nick Koston 9cbb14bbde Bump inkbird-ble to 1.1.2 (#172011) 2026-05-24 08:41:11 +02:00
Allen Porter 6634c4ce78 Replace duplicate constant ATTR_ELEVATION in fitbit (#172018) 2026-05-24 08:40:32 +02:00
Allen Porter ae1355666b Remove positional message strings from roborock exceptions (#172016) 2026-05-23 22:14:12 -07:00
Allen Porter 2d0d202b80 Fix exception translation placeholder mismatch in roborock (#172014) 2026-05-23 22:14:02 -07:00
skye-harris 9fd48344f8 Reorder device location context towards the end of the Assist LLM instructions (#165136) 2026-05-23 20:51:17 -07:00
J. Nick Koston 7b4ed59861 Change default ESPHome bluetooth proxy scanning mode to Auto (#171996) 2026-05-23 18:21:37 -05:00
J. Nick Koston fb8f82542e Use AlarmControlPanelEntityFeature from aioesphomeapi in esphome (#171961) 2026-05-23 19:08:52 -04:00
Robert Svensson af5583ba76 Axis bump to v72 (#171967) 2026-05-23 19:06:47 -04:00
J. Nick Koston 2a943369d5 Change default Bluetooth scanning mode to Auto (#171985) 2026-05-23 17:44:19 -05:00
J. Nick Koston 29425fd0ac Bump bleak-esphome to 3.9.1 (#171994) 2026-05-23 17:25:35 -05:00
Markus Adrario 271111fe75 Homee: Update quality-scale for current state. (#171981) 2026-05-23 22:17:02 +02:00
J. Nick Koston 37e9bdd36f Wire scan_interval and scan_duration into bluetooth.async_register_callback (#171806) 2026-05-23 15:34:31 -04:00
J. Nick Koston e1d1bdd377 Bump aioesphomeapi to 45.2.0 (#171986) 2026-05-23 14:34:01 -05:00
J. Nick Koston b3a60de487 Bump habluetooth to 6.5.0 (#171966) 2026-05-23 14:33:42 -05:00
Michael 0cb7ea5584 Improve switch definitions in FRITZ!Box Tools (#171862) 2026-05-23 21:19:22 +02:00
Max Michels 7bc7694e14 Replace duplicate constants in ios with homeassistant.const imports (#171973) 2026-05-23 19:40:31 +02:00
Max Michels c45c949080 Replace duplicate constants in wiz with homeassistant.const imports (#171969) 2026-05-23 19:01:03 +02:00
SeifEddineMezned ec4f64172b Fix grammar and clarity in homekit_controller/strings.json (#169625) 2026-05-23 17:52:39 +02:00
Max Michels f88b7bcdf6 Replace duplicate constants in olama with homeassistant.const imports (#171949)
Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2026-05-23 17:03:44 +02:00
Max Michels 05009871aa Replace duplicate constants in numato with homeassistant.const imports (#171950) 2026-05-23 16:57:46 +02:00
Max Michels 4aa7323af2 Replace duplicate constants in nmbs with homeassistant.const imports (#171951) 2026-05-23 16:57:07 +02:00
Max Michels bcacf3a73c Remove unused duplicate constants in nice_go with homeassistant.const imports (#171952) 2026-05-23 16:56:16 +02:00
Maciej Bieniek 96a6babaef Remove Shelly temperature and humidity sensors with error (#170900) 2026-05-23 14:02:32 +02:00
Max Michels e856271a5a Replace duplicate constants in motioneye with homeassistant.const imports (#171954)
Co-authored-by: Erwin Douna <e.douna@gmail.com>
2026-05-23 12:05:02 +02:00
Max Michels add023ed74 Replace duplicate constants in openerz with homeassistant.const imports (#171946) 2026-05-23 11:58:51 +02:00
Max Michels 8d456cb24f Replace duplicate constants osoenergy with homeassistant.const imports (#171944) 2026-05-23 11:52:54 +02:00
Max Michels 5ebd95eb34 Replace duplicate constants in netatmo with homeassistant.const imports (#171953) 2026-05-23 11:47:58 +02:00
Max Michels 228d7189c3 Replace duplicate constants in profiler with homeassistant.const imports (#171943) 2026-05-23 11:01:02 +02:00
Max Michels a8e141a48a Replace duplicate constants in rainmachine with homeassistant.const imports (#171942)
Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2026-05-23 10:59:53 +02:00
Max Michels d42d52a0f7 Replace duplicate constants in onkyo with homeassistant.const imports (#171947) 2026-05-23 10:57:48 +02:00
Mick Vleeshouwer cee0fe071d Fix tilt-only DynamicPergola covers in Overkiz (#171898) 2026-05-23 10:52:16 +02:00
Josh Gustafson e3593c3076 Arcam reconfig flow (#171767) 2026-05-23 10:24:28 +02:00
Martin Hjelmare 5498de07ff Remove legacy Konnected integration (#171896) 2026-05-23 10:19:35 +02:00
J. Nick Koston ac3f973d7d Bump aioesphomeapi to 45.1.0 (#171935) 2026-05-23 09:47:15 +02:00
J. Nick Koston 6b8a2a4032 Bump bleak-esphome to 3.8.1 (#171936) 2026-05-23 09:46:49 +02:00
Artur Pragacz 74e40af4bb Remove CLOUD_NEVER_EXPOSED_ENTITIES (#171933) 2026-05-23 00:26:45 -04:00
J. Nick Koston 833e15d6f2 Bump habluetooth to 6.4.0 (#171918) 2026-05-23 00:10:50 -04:00
Matt ee56fd1eb0 Fix two HEOS bugs: host set construction and missing error decorator (#171913) 2026-05-22 18:42:43 -05:00
Felipe Santos e6528bae8a Add missing translation for connection failure on OpenRGB (#171892) 2026-05-22 21:59:39 +02:00
Joost Lekkerkerker a17eb65498 Refactor labs websocket API tests to use async_setup_component (#171891) 2026-05-22 21:53:52 +02:00
Joost Lekkerkerker 912a839d66 Don't call migrate entry in generic thermostat tests directly (#171887) 2026-05-22 21:44:10 +02:00
Martin Hjelmare 4306863729 Fix homekit test_reload flaky test (#171878) 2026-05-22 14:33:27 -05:00
Martin Hjelmare ba2f66e751 Remove not needed default force_update in flo (#171854) 2026-05-22 20:15:00 +02:00
Manu 94581d8ab6 Move service registration in System Bridge integration to async_setup (#171761)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-22 18:43:22 +02:00
Ingo Fischer 7d6ec7fc58 Bump matter-python-client to 0.7.1 (#171764)
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2026-05-22 17:34:20 +01:00
Jan Bouwhuis f49de3548e Add MQTT message expiry interval option (#171143) 2026-05-22 18:27:22 +02:00
Manu 49ab42d3a2 Fix dead link in System Bridge service action (#171855) 2026-05-22 17:00:30 +02:00
Franck Nijhof 383f6142f0 Fix ZBT-2 hardware page crash when entry data is missing VID (#171828) 2026-05-22 16:58:01 +02:00
Kamil Breguła 2f120cf604 Fix rgb_color passed as RGBColor NamedTuple instead of plain tuple to light entity turn_on (#171795)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 16:56:34 +02:00
Franck Nijhof 37288849b3 Register Insteon modem device before platform setup (#171839) 2026-05-22 10:23:47 -04:00
zhangluofeng aa8659f507 Add xthings cloud lock (#171176)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2026-05-22 15:54:37 +02:00
DeerMaximum 40c0d79d1d Replaced duplicate constant with homeassistant.const in NINA (#171852) 2026-05-22 15:41:04 +02:00
Franck Nijhof bef8632d78 Fix OpenHome config flow crash when UDN is a list (#171841) 2026-05-22 15:23:42 +02:00
Duco Sebel f00decfaa3 Use uptime device class for HomeWizard uptime sensor (#171830) 2026-05-22 15:23:09 +02:00
Manu 42e7add026 Add selector options translations to System Bridge integration (#171771) 2026-05-22 15:22:22 +02:00
Franck Nijhof 263aa3f16e Fix Hue device trigger crash for devices removed from bridge (#171844) 2026-05-22 15:18:00 +02:00
mhuiskes 03b364dcf0 Refactor zeversolar tests: use fixtures, patch at use site, add unique_id (#171697) 2026-05-22 14:58:56 +02:00
Duco Sebel 3b1aaf39af Bumb python homewizard energy 10.1.0 (#171826) 2026-05-22 14:51:58 +02:00
Franck Nijhof b82ba43fa4 Add pylint checker for invalid MDI icon references (#171824)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 13:45:40 +02:00
starkillerOG d81ef5593c Bump reolink_aio to 0.20.0: Reolink battery camera support (#171836) 2026-05-22 12:59:33 +02:00
Manu 5c5e50f024 Fix platform unloading in System Bridge integration (#171822) 2026-05-22 12:56:03 +02:00
Lex Postma e796d9c467 Update strings.json to align with HomeWizard app (#171740)
Co-authored-by: Duco Sebel <74970928+DCSBL@users.noreply.github.com>
2026-05-22 12:54:58 +02:00
Karl Beecken 342f23526f Remove empty requirements_test_all.txt (#171530 follow-up) (#171834) 2026-05-22 12:38:58 +02:00
Erik Montnemery 814ec697cf Remove advanced mode from hue service actions (#171442) 2026-05-22 11:45:33 +02:00
Erik Montnemery 120f1446d4 Rename advanced section to additional options in telegram_bot service actions (#171460) 2026-05-22 11:44:05 +02:00
Franck Nijhof 170af75b7d Fix Lutron Caseta battery sensor crash on unsupported devices (#171829) 2026-05-22 11:37:05 +02:00
Ariel Ebersberger 5432d29489 Use is/is not for same-enum identity comparisons (tests) (#171689) 2026-05-22 11:32:27 +02:00
Franck Nijhof 8098f4f6bc Fix invalid MDI icon references (#171831)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-22 11:25:28 +02:00
Simone Chemelli 6a70077687 Fix exception translation placeholder mismatches in comelit (#171748) 2026-05-22 11:17:17 +02:00
Max Michels 5dbb0464ba Replace duplicate constants with homeassistant.const imports (#171815) 2026-05-22 11:10:21 +02:00
dependabot[bot] 1df165ea02 Bump j178/prek-action from 2.0.3 to 2.0.4 (#171812)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-22 10:39:43 +02:00
Manu 62542eb911 Replace duplicate constants with homeassistant.const imports in xiaomi_miio (#171823) 2026-05-22 10:39:09 +02:00
Max Michels a842cac34c Replace duplicate constants with homeassistant.const imports (#171817) 2026-05-22 10:38:06 +02:00
Simone Chemelli 2460f688e3 Add missing exception translation keys in alexa_devices (#171749) 2026-05-22 10:34:00 +02:00
Simone Chemelli a868ea443c Fix hardcoded exception strings in uptimerobot (#171744) 2026-05-22 10:33:07 +02:00
Franck Nijhof 1d8565483b Apply web search citation stripping for GPT-5.x models in OpenAI conversation (#170956) 2026-05-22 10:31:10 +02:00
dependabot[bot] 1ef3301253 Bump github/codeql-action from 4.35.4 to 4.35.5 (#171813)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-22 09:47:16 +02:00
Manu 525952f016 Add entity translations to System Bridge integration (#171807) 2026-05-22 09:00:54 +02:00
Shay Levy 3257275c5a Fix LG webOS TV hardcoded exception strings (#171777) 2026-05-22 08:28:19 +02:00
Max Michels cb54fd4921 Replace duplicate constants with homeassistant.const imports (#171809) 2026-05-22 07:57:08 +02:00
Max Michels b391fc61ea Replace duplicate constants with homeassistant.const imports (#171808) 2026-05-22 07:56:29 +02:00
J. Nick Koston fcd4e4939c Bump habluetooth to 6.2.0 (#171800) 2026-05-21 23:08:17 -05:00
J. Nick Koston deb8b5da05 Parallelize pytest --collect-only in split_tests.py (#171772) 2026-05-21 22:58:01 -04:00
g4bri3lDev c7754a6ce9 Bump py-opendisplay to 7.2.3 (#171775) 2026-05-21 22:52:36 -04:00
J. Nick Koston 242724bd50 Bump aiodiscover to 3.2.3 (#171803) 2026-05-21 22:51:54 -04:00
Max Michels 42454563db Replace duplicate constants with homeassistant.const imports (#171790)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-21 22:51:34 -04:00
J. Nick Koston bf03d0c216 Bump dbus-fast to 5.0.3 (#171595) 2026-05-21 21:11:35 -05:00
Max Michels 568107e06b Replace duplicate constants with homeassistant.const imports (#171784) 2026-05-22 01:33:48 +03:00
Jens Timmerman 7da44428b6 Bump guntamatic to v1.9.0 (#171631) 2026-05-21 22:55:29 +01:00
Max Michels 0a27f31949 Replace duplicate constants with homeassistant.const imports (#171781) 2026-05-21 22:53:07 +01:00
Erwin Douna 905b868c82 Add recreate services to Portainer (#167225)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2026-05-21 22:52:07 +01:00
Max Michels 3187289913 Replace duplicate constants with homeassistant.const imports (#171776) 2026-05-22 00:18:54 +03:00
Max Michels 87cecd4a44 Replace duplicate constants with homeassistant.const imports (#171778) 2026-05-22 00:18:23 +03:00
Robert Svensson fed38b0e38 Replace duplicate ATTR_LOCKED constant with homeassistant.const import in deconz (#171779) 2026-05-22 00:17:22 +03:00
Raphael Hehl 6a36d1260b Bump uiprotect to 10.5.0 (#171768)
Co-authored-by: RaHehl <rahehl@users.noreply.github.com>
2026-05-21 15:42:31 -05:00
Raphael Hehl 49fc1b413d Bump pydantic to 2.13.4 (#171763)
Co-authored-by: RaHehl <rahehl@users.noreply.github.com>
2026-05-21 14:42:06 -05:00
Abílio Costa bffb0417cc Instruct agents to run prek after doing changes (#171757) 2026-05-21 20:16:26 +01:00
G Johansson 8b8c687fc3 Remove not needed exception handling in dnsip (#171758) 2026-05-21 20:58:32 +02:00
964 changed files with 17763 additions and 8224 deletions
+9
View File
@@ -0,0 +1,9 @@
{
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.0",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
}
}
}
+1
View File
@@ -15,6 +15,7 @@ Dockerfile.dev linguist-language=Dockerfile
# Generated files
CODEOWNERS linguist-generated=true
homeassistant/generated/*.py linguist-generated=true
pylint/plugins/pylint_home_assistant/generated/*.py linguist-generated=true
machine/* linguist-generated=true
mypy.ini linguist-generated=true
requirements.txt linguist-generated=true
+1
View File
@@ -25,6 +25,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing.
- .vscode/tasks.json contains useful commands used for development.
- After finishing a code session, run `uv run prek run --all-files` to check for linting and formatting issues.
## Python Syntax Notes
+2 -2
View File
@@ -281,7 +281,7 @@ jobs:
echo "::add-matcher::.github/workflows/matchers/check-executables-have-shebangs.json"
echo "::add-matcher::.github/workflows/matchers/codespell.json"
- name: Run prek
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3
uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
env:
PREK_SKIP: no-commit-to-branch,mypy,pylint,gen_requirements_all,hassfest,hassfest-metadata,hassfest-mypy-config,zizmor
RUFF_OUTPUT_FORMAT: github
@@ -302,7 +302,7 @@ jobs:
with:
persist-credentials: false
- name: Run zizmor
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3
uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
with:
extra-args: --all-files zizmor
+2 -2
View File
@@ -28,11 +28,11 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
uses: github/codeql-action/init@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
uses: github/codeql-action/init@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@68bde559dea0fdcac2102bfdf6230c5f70eb485e # v4.35.4
uses: github/codeql-action/analyze@9e0d7b8d25671d64c341c19c0152d693099fb5ba # v4.35.5
with:
category: "/language:python"
+1
View File
@@ -15,6 +15,7 @@ This repository contains the core of Home Assistant, a Python 3 based home autom
- When entering a new environment or worktree, run `script/setup` to set up the virtual environment with all development dependencies (pylint, pre-commit hooks, etc.). This is required before committing.
- .vscode/tasks.json contains useful commands used for development.
- After finishing a code session, run `uv run prek run --all-files` to check for linting and formatting issues.
## Python Syntax Notes
Generated
+2 -4
View File
@@ -236,8 +236,8 @@ CLAUDE.md @home-assistant/core
/tests/components/blebox/ @bbx-a @swistakm @bkobus-bbx
/homeassistant/components/blink/ @fronzbot
/tests/components/blink/ @fronzbot
/homeassistant/components/blue_current/ @gleeuwen @NickKoepr @jtodorova23
/tests/components/blue_current/ @gleeuwen @NickKoepr @jtodorova23
/homeassistant/components/blue_current/ @gleeuwen @jtodorova23
/tests/components/blue_current/ @gleeuwen @jtodorova23
/homeassistant/components/bluemaestro/ @bdraco
/tests/components/bluemaestro/ @bdraco
/homeassistant/components/blueprint/ @home-assistant/core
@@ -945,8 +945,6 @@ CLAUDE.md @home-assistant/core
/tests/components/knx/ @Julius2342 @farmio @marvin-w
/homeassistant/components/kodi/ @OnFreund
/tests/components/kodi/ @OnFreund
/homeassistant/components/konnected/ @heythisisnate
/tests/components/konnected/ @heythisisnate
/homeassistant/components/kostal_plenticore/ @stegm
/tests/components/kostal_plenticore/ @stegm
/homeassistant/components/kraken/ @eifinger
@@ -1,5 +1,7 @@
"""Support for Abode Security System alarm control panels."""
from typing import override
from jaraco.abode.devices.alarm import Alarm
from homeassistant.components.alarm_control_panel import (
@@ -37,6 +39,7 @@ class AbodeAlarm(AbodeDevice, AlarmControlPanelEntity):
)
_device: Alarm
@override
@property
def alarm_state(self) -> AlarmControlPanelState | None:
"""Return the state of the device."""
@@ -48,18 +51,22 @@ class AbodeAlarm(AbodeDevice, AlarmControlPanelEntity):
return AlarmControlPanelState.ARMED_HOME
return None
@override
def alarm_disarm(self, code: str | None = None) -> None:
"""Send disarm command."""
self._device.set_standby()
@override
def alarm_arm_home(self, code: str | None = None) -> None:
"""Send arm home command."""
self._device.set_home()
@override
def alarm_arm_away(self, code: str | None = None) -> None:
"""Send arm away command."""
self._device.set_away()
@override
@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return the state attributes."""
@@ -1,6 +1,6 @@
"""Support for Abode Security System binary sensors."""
from typing import cast
from typing import cast, override
from jaraco.abode.devices.binary_sensor import BinarySensor
@@ -44,11 +44,13 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorEntity):
_attr_name = None
_device: BinarySensor
@override
@property
def is_on(self) -> bool:
"""Return True if the binary sensor is on."""
return cast(bool, self._device.is_on)
@override
@property
def device_class(self) -> BinarySensorDeviceClass | None:
"""Return the class of the binary sensor."""
+6 -1
View File
@@ -1,7 +1,7 @@
"""Support for Abode Security System cameras."""
from datetime import timedelta
from typing import Any, cast
from typing import Any, cast, override
from jaraco.abode.devices.base import Device
from jaraco.abode.devices.camera import Camera as AbodeCam
@@ -49,6 +49,7 @@ class AbodeCamera(AbodeDevice, Camera):
self._event = event
self._response: Response | None = None
@override
async def async_added_to_hass(self) -> None:
"""Subscribe Abode events."""
await super().async_added_to_hass()
@@ -87,6 +88,7 @@ class AbodeCamera(AbodeDevice, Camera):
else:
self._response = None
@override
def camera_image(
self, width: int | None = None, height: int | None = None
) -> bytes | None:
@@ -98,10 +100,12 @@ class AbodeCamera(AbodeDevice, Camera):
return None
@override
def turn_on(self) -> None:
"""Turn on camera."""
self._device.privacy_mode(False)
@override
def turn_off(self) -> None:
"""Turn off camera."""
self._device.privacy_mode(True)
@@ -112,6 +116,7 @@ class AbodeCamera(AbodeDevice, Camera):
self.get_image()
self.schedule_update_ha_state()
@override
@property
def is_on(self) -> bool:
"""Return true if on."""
@@ -2,7 +2,7 @@
from collections.abc import Mapping
from http import HTTPStatus
from typing import Any, cast
from typing import Any, cast, override
from jaraco.abode.client import Client as Abode
from jaraco.abode.exceptions import (
@@ -106,6 +106,7 @@ class AbodeFlowHandler(ConfigFlow, domain=DOMAIN):
title=cast(str, self._username), data=config_data
)
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
+4 -1
View File
@@ -1,6 +1,6 @@
"""Support for Abode Security System covers."""
from typing import Any
from typing import Any, override
from jaraco.abode.devices.cover import Cover
@@ -32,15 +32,18 @@ class AbodeCover(AbodeDevice, CoverEntity):
_device: Cover
_attr_name = None
@override
@property
def is_closed(self) -> bool:
"""Return true if cover is closed, else False."""
return not self._device.is_open
@override
def close_cover(self, **kwargs: Any) -> None:
"""Issue close command to cover."""
self._device.close_cover()
@override
def open_cover(self, **kwargs: Any) -> None:
"""Issue open command to cover."""
self._device.open_cover()
+8
View File
@@ -1,5 +1,7 @@
"""Support for Abode Security System entities."""
from typing import override
from jaraco.abode.automation import Automation as AbodeAuto
from jaraco.abode.devices.base import Device as AbodeDev
@@ -21,6 +23,7 @@ class AbodeEntity(Entity):
self._data = data
self._attr_should_poll = data.polling
@override
async def async_added_to_hass(self) -> None:
"""Subscribe to Abode connection status updates."""
await self.hass.async_add_executor_job(
@@ -31,6 +34,7 @@ class AbodeEntity(Entity):
self._data.entity_ids.add(self.entity_id)
@override
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from Abode connection status updates."""
await self.hass.async_add_executor_job(
@@ -52,6 +56,7 @@ class AbodeDevice(AbodeEntity):
self._device = device
self._attr_unique_id = device.uuid
@override
async def async_added_to_hass(self) -> None:
"""Subscribe to device events."""
await super().async_added_to_hass()
@@ -61,6 +66,7 @@ class AbodeDevice(AbodeEntity):
self._update_callback,
)
@override
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from device events."""
await super().async_will_remove_from_hass()
@@ -72,6 +78,7 @@ class AbodeDevice(AbodeEntity):
"""Update device state."""
self._device.refresh()
@override
@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return the state attributes."""
@@ -82,6 +89,7 @@ class AbodeDevice(AbodeEntity):
"device_type": self._device.type,
}
@override
@property
def device_info(self) -> DeviceInfo:
"""Return device registry information for this entity."""
+9 -1
View File
@@ -1,7 +1,7 @@
"""Support for Abode Security System lights."""
from math import ceil
from typing import Any
from typing import Any, override
from jaraco.abode.devices.light import Light
@@ -43,6 +43,7 @@ class AbodeLight(AbodeDevice, LightEntity):
_attr_max_color_temp_kelvin = DEFAULT_MAX_KELVIN
_attr_min_color_temp_kelvin = DEFAULT_MIN_KELVIN
@override
def turn_on(self, **kwargs: Any) -> None:
"""Turn on the light."""
if ATTR_COLOR_TEMP_KELVIN in kwargs and self._device.is_color_capable:
@@ -61,15 +62,18 @@ class AbodeLight(AbodeDevice, LightEntity):
self._device.switch_on()
@override
def turn_off(self, **kwargs: Any) -> None:
"""Turn off the light."""
self._device.switch_off()
@override
@property
def is_on(self) -> bool:
"""Return true if device is on."""
return bool(self._device.is_on)
@override
@property
def brightness(self) -> int | None:
"""Return the brightness of the light."""
@@ -80,6 +84,7 @@ class AbodeLight(AbodeDevice, LightEntity):
return 255 if brightness == 100 else ceil(brightness * 255 / 99.0)
return None
@override
@property
def color_temp_kelvin(self) -> int | None:
"""Return the color temp of the light."""
@@ -87,6 +92,7 @@ class AbodeLight(AbodeDevice, LightEntity):
return int(self._device.color_temp)
return None
@override
@property
def hs_color(self) -> tuple[float, float] | None:
"""Return the color of the light."""
@@ -95,6 +101,7 @@ class AbodeLight(AbodeDevice, LightEntity):
_hs = self._device.color
return _hs
@override
@property
def color_mode(self) -> ColorMode:
"""Return the color mode of the light."""
@@ -106,6 +113,7 @@ class AbodeLight(AbodeDevice, LightEntity):
return ColorMode.BRIGHTNESS
return ColorMode.ONOFF
@override
@property
def supported_color_modes(self) -> set[ColorMode]:
"""Flag supported color modes."""
+4 -1
View File
@@ -1,6 +1,6 @@
"""Support for the Abode Security System locks."""
from typing import Any
from typing import Any, override
from jaraco.abode.devices.lock import Lock
@@ -32,14 +32,17 @@ class AbodeLock(AbodeDevice, LockEntity):
_device: Lock
_attr_name = None
@override
def lock(self, **kwargs: Any) -> None:
"""Lock the device."""
self._device.lock()
@override
def unlock(self, **kwargs: Any) -> None:
"""Unlock the device."""
self._device.unlock()
@override
@property
def is_locked(self) -> bool:
"""Return true if device is on."""
+3 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import cast
from typing import cast, override
from jaraco.abode.devices.sensor import Sensor
@@ -93,11 +93,13 @@ class AbodeSensor(AbodeDevice, SensorEntity):
self.entity_description = description
self._attr_unique_id = f"{device.uuid}-{description.key}"
@override
@property
def native_value(self) -> float:
"""Return the state of the sensor."""
return self.entity_description.value_fn(self._device)
@override
@property
def native_unit_of_measurement(self) -> str:
"""Return the native unit of measurement."""
+8 -1
View File
@@ -1,6 +1,6 @@
"""Support for Abode Security System switches."""
from typing import Any, cast
from typing import Any, cast, override
from jaraco.abode.devices.switch import Switch
@@ -43,14 +43,17 @@ class AbodeSwitch(AbodeDevice, SwitchEntity):
_device: Switch
_attr_name = None
@override
def turn_on(self, **kwargs: Any) -> None:
"""Turn on the device."""
self._device.switch_on()
@override
def turn_off(self, **kwargs: Any) -> None:
"""Turn off the device."""
self._device.switch_off()
@override
@property
def is_on(self) -> bool:
"""Return true if device is on."""
@@ -62,6 +65,7 @@ class AbodeAutomationSwitch(AbodeAutomation, SwitchEntity):
_attr_translation_key = "automation"
@override
async def async_added_to_hass(self) -> None:
"""Set up trigger automation service."""
await super().async_added_to_hass()
@@ -69,11 +73,13 @@ class AbodeAutomationSwitch(AbodeAutomation, SwitchEntity):
signal = f"abode_trigger_automation_{self.entity_id}"
self.async_on_remove(async_dispatcher_connect(self.hass, signal, self.trigger))
@override
def turn_on(self, **kwargs: Any) -> None:
"""Enable the automation."""
if self._automation.enable(True):
self.schedule_update_ha_state()
@override
def turn_off(self, **kwargs: Any) -> None:
"""Disable the automation."""
if self._automation.enable(False):
@@ -83,6 +89,7 @@ class AbodeAutomationSwitch(AbodeAutomation, SwitchEntity):
"""Trigger the automation."""
self._automation.trigger()
@override
@property
def is_on(self) -> bool:
"""Return True if the automation is enabled."""
@@ -2,6 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import override
from aioacaia.acaiascale import AcaiaScale
@@ -55,6 +56,7 @@ class AcaiaBinarySensor(AcaiaEntity, BinarySensorEntity):
entity_description: AcaiaBinarySensorEntityDescription
@override
@property
def is_on(self) -> bool:
"""Return true if the binary sensor is on."""
+2 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from aioacaia.acaiascale import AcaiaScale
@@ -58,6 +58,7 @@ class AcaiaButton(AcaiaEntity, ButtonEntity):
entity_description: AcaiaButtonEntityDescription
@override
async def async_press(self) -> None:
"""Handle the button press."""
await self.entity_description.press_fn(self._scale)
@@ -1,7 +1,7 @@
"""Config flow for Acaia integration."""
import logging
from typing import Any
from typing import Any, override
from aioacaia.exceptions import AcaiaDeviceNotFound, AcaiaError, AcaiaUnknownDevice
from aioacaia.helpers import is_new_scale
@@ -34,6 +34,7 @@ class AcaiaConfigFlow(ConfigFlow, domain=DOMAIN):
self._discovered: dict[str, Any] = {}
self._discovered_devices: dict[str, str] = {}
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -94,6 +95,7 @@ class AcaiaConfigFlow(ConfigFlow, domain=DOMAIN):
errors=errors,
)
@override
async def async_step_bluetooth(
self, discovery_info: BluetoothServiceInfoBleak
) -> ConfigFlowResult:
@@ -2,6 +2,7 @@
from datetime import timedelta
import logging
from typing import override
from aioacaia.acaiascale import AcaiaScale
from aioacaia.exceptions import AcaiaDeviceNotFound, AcaiaError
@@ -59,6 +60,7 @@ class AcaiaCoordinator(DataUpdateCoordinator[None]):
"""Return the scale object."""
return self._scale
@override
async def _async_update_data(self) -> None:
"""Fetch data."""
+2
View File
@@ -1,6 +1,7 @@
"""Base class for Acaia entities."""
from dataclasses import dataclass
from typing import override
from homeassistant.helpers.device_registry import (
CONNECTION_BLUETOOTH,
@@ -40,6 +41,7 @@ class AcaiaEntity(CoordinatorEntity[AcaiaCoordinator]):
connections={(CONNECTION_BLUETOOTH, self._scale.mac)},
)
@override
@property
def available(self) -> bool:
"""Returns whether entity is available."""
+6
View File
@@ -2,6 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import override
from aioacaia.acaiascale import AcaiaDeviceState, AcaiaScale
from aioacaia.const import UnitMass as AcaiaUnitOfMass
@@ -97,6 +98,7 @@ class AcaiaSensor(AcaiaEntity, SensorEntity):
entity_description: AcaiaDynamicUnitSensorEntityDescription
@override
@property
def native_unit_of_measurement(self) -> str | None:
"""Return the unit of measurement of this entity."""
@@ -107,6 +109,7 @@ class AcaiaSensor(AcaiaEntity, SensorEntity):
return self.entity_description.unit_fn(self._scale.device_state)
return self.entity_description.native_unit_of_measurement
@override
@property
def native_value(self) -> int | float | None:
"""Return the state of the entity."""
@@ -119,6 +122,7 @@ class AcaiaRestoreSensor(AcaiaEntity, RestoreSensor):
entity_description: AcaiaSensorEntityDescription
_restored_data: SensorExtraStoredData | None = None
@override
async def async_added_to_hass(self) -> None:
"""Handle entity which will be added."""
await super().async_added_to_hass()
@@ -133,6 +137,7 @@ class AcaiaRestoreSensor(AcaiaEntity, RestoreSensor):
if self._scale.device_state is not None:
self._attr_native_value = self.entity_description.value_fn(self._scale)
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
@@ -140,6 +145,7 @@ class AcaiaRestoreSensor(AcaiaEntity, RestoreSensor):
self._attr_native_value = self.entity_description.value_fn(self._scale)
self._async_write_ha_state()
@override
@property
def available(self) -> bool:
"""Return True if entity is available."""
@@ -2,7 +2,7 @@
from asyncio import timeout
from collections.abc import Mapping
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, override
from accuweather import AccuWeather, ApiError, InvalidApiKeyError, RequestsExceededError
from aiohttp import ClientError
@@ -24,6 +24,7 @@ class AccuWeatherFlowHandler(ConfigFlow, domain=DOMAIN):
_latitude: float | None = None
_longitude: float | None = None
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -5,7 +5,7 @@ from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, override
from accuweather import AccuWeather, ApiError, InvalidApiKeyError, RequestsExceededError
from aiohttp.client_exceptions import ClientConnectorError
@@ -77,6 +77,7 @@ class AccuWeatherObservationDataUpdateCoordinator(
update_interval=UPDATE_INTERVAL_OBSERVATION,
)
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Update data via library."""
try:
@@ -135,6 +136,7 @@ class AccuWeatherForecastDataUpdateCoordinator(
update_interval=update_interval,
)
@override
async def _async_update_data(self) -> list[dict[str, Any]]:
"""Update forecast data via library."""
try:
@@ -2,7 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, cast
from typing import Any, cast, override
from homeassistant.components.sensor import (
SensorDeviceClass,
@@ -434,16 +434,19 @@ class AccuWeatherSensor(
self._attr_unique_id = f"{coordinator.location_key}-{description.key}".lower()
self._attr_device_info = coordinator.device_info
@override
@property
def native_value(self) -> str | int | float | None:
"""Return the state."""
return self.entity_description.value_fn(self._sensor_data)
@override
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the state attributes."""
return self.entity_description.attr_fn(self.coordinator.data)
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle data update."""
@@ -493,16 +496,19 @@ class AccuWeatherForecastSensor(
self._attr_translation_placeholders = {"forecast_day": str(forecast_day)}
self.forecast_day = forecast_day
@override
@property
def native_value(self) -> str | int | float | None:
"""Return the state."""
return self.entity_description.value_fn(self._sensor_data)
@override
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the state attributes."""
return self.entity_description.attr_fn(self._sensor_data)
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle data update."""
@@ -1,6 +1,6 @@
"""Support for the AccuWeather service."""
from typing import cast
from typing import cast, override
from homeassistant.components.weather import (
ATTR_FORECAST_CLOUD_COVERAGE,
@@ -95,16 +95,19 @@ class AccuWeatherEntity(
self.daily_coordinator = accuweather_data.coordinator_daily_forecast
self.hourly_coordinator = accuweather_data.coordinator_hourly_forecast
@override
@property
def condition(self) -> str | None:
"""Return the current condition."""
return CONDITION_MAP.get(self.observation_coordinator.data["WeatherIcon"])
@override
@property
def cloud_coverage(self) -> float:
"""Return the Cloud coverage in %."""
return cast(float, self.observation_coordinator.data["CloudCover"])
@override
@property
def native_apparent_temperature(self) -> float:
"""Return the apparent temperature."""
@@ -115,6 +118,7 @@ class AccuWeatherEntity(
],
)
@override
@property
def native_temperature(self) -> float:
"""Return the temperature."""
@@ -123,6 +127,7 @@ class AccuWeatherEntity(
self.observation_coordinator.data["Temperature"][API_METRIC][ATTR_VALUE],
)
@override
@property
def native_pressure(self) -> float:
"""Return the pressure."""
@@ -130,6 +135,7 @@ class AccuWeatherEntity(
float, self.observation_coordinator.data["Pressure"][API_METRIC][ATTR_VALUE]
)
@override
@property
def native_dew_point(self) -> float:
"""Return the dew point."""
@@ -137,11 +143,13 @@ class AccuWeatherEntity(
float, self.observation_coordinator.data["DewPoint"][API_METRIC][ATTR_VALUE]
)
@override
@property
def humidity(self) -> int:
"""Return the humidity."""
return cast(int, self.observation_coordinator.data["RelativeHumidity"])
@override
@property
def native_wind_gust_speed(self) -> float:
"""Return the wind gust speed."""
@@ -152,6 +160,7 @@ class AccuWeatherEntity(
],
)
@override
@property
def native_wind_speed(self) -> float:
"""Return the wind speed."""
@@ -162,6 +171,7 @@ class AccuWeatherEntity(
],
)
@override
@property
def wind_bearing(self) -> int:
"""Return the wind bearing."""
@@ -169,6 +179,7 @@ class AccuWeatherEntity(
int, self.observation_coordinator.data["Wind"][ATTR_DIRECTION]["Degrees"]
)
@override
@property
def native_visibility(self) -> float:
"""Return the visibility."""
@@ -177,11 +188,13 @@ class AccuWeatherEntity(
self.observation_coordinator.data["Visibility"][API_METRIC][ATTR_VALUE],
)
@override
@property
def uv_index(self) -> float:
"""Return the UV index."""
return cast(float, self.observation_coordinator.data["UVIndex"])
@override
@callback
def _async_forecast_daily(self) -> list[Forecast] | None:
"""Return the daily forecast in native units."""
@@ -212,6 +225,7 @@ class AccuWeatherEntity(
for item in self.daily_coordinator.data
]
@override
@callback
def _async_forecast_hourly(self) -> list[Forecast] | None:
"""Return the hourly forecast in native units."""
@@ -2,7 +2,7 @@
import logging
import re
from typing import Any
from typing import Any, override
from serialx import Serial, SerialException
import voluptuous as vol
@@ -140,12 +140,14 @@ class AcerSwitch(SwitchEntity):
self._attributes[key] = awns
self._attr_extra_state_attributes = self._attributes
@override
def turn_on(self, **kwargs: Any) -> None:
"""Turn the projector on."""
msg = CMD_DICT[STATE_ON]
self._write_read(msg)
self._attr_is_on = True
@override
def turn_off(self, **kwargs: Any) -> None:
"""Turn the projector off."""
msg = CMD_DICT[STATE_OFF]
@@ -2,7 +2,7 @@
from asyncio import timeout
from contextlib import suppress
from typing import Any
from typing import Any, override
import aiopulse
import voluptuous as vol
@@ -22,6 +22,7 @@ class AcmedaFlowHandler(ConfigFlow, domain=DOMAIN):
"""Initialize the config flow."""
self.discovered_hubs: dict[str, aiopulse.Hub] | None = None
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
+13 -1
View File
@@ -1,6 +1,6 @@
"""Support for Acmeda Roller Blinds."""
from typing import Any
from typing import Any, override
from homeassistant.components.cover import (
ATTR_POSITION,
@@ -47,6 +47,7 @@ class AcmedaCover(AcmedaEntity, CoverEntity):
_attr_name = None
@override
@property
def current_cover_position(self) -> int | None:
"""Return the current position of the roller blind.
@@ -58,6 +59,7 @@ class AcmedaCover(AcmedaEntity, CoverEntity):
position = 100 - self.roller.closed_percent
return position
@override
@property
def current_cover_tilt_position(self) -> int | None:
"""Return the current tilt of the roller blind.
@@ -69,6 +71,7 @@ class AcmedaCover(AcmedaEntity, CoverEntity):
position = 100 - self.roller.closed_percent
return position
@override
@property
def supported_features(self) -> CoverEntityFeature:
"""Flag supported features."""
@@ -90,39 +93,48 @@ class AcmedaCover(AcmedaEntity, CoverEntity):
return supported_features
@override
@property
def is_closed(self) -> bool:
"""Return if the cover is closed."""
return self.roller.closed_percent == 100 # type: ignore[no-any-return]
@override
async def async_close_cover(self, **kwargs: Any) -> None:
"""Close the roller."""
await self.roller.move_down()
@override
async def async_open_cover(self, **kwargs: Any) -> None:
"""Open the roller."""
await self.roller.move_up()
@override
async def async_stop_cover(self, **kwargs: Any) -> None:
"""Stop the roller."""
await self.roller.move_stop()
@override
async def async_set_cover_position(self, **kwargs: Any) -> None:
"""Move the roller shutter to a specific position."""
await self.roller.move_to(100 - kwargs[ATTR_POSITION])
@override
async def async_close_cover_tilt(self, **kwargs: Any) -> None:
"""Close the roller."""
await self.roller.move_down()
@override
async def async_open_cover_tilt(self, **kwargs: Any) -> None:
"""Open the roller."""
await self.roller.move_up()
@override
async def async_stop_cover_tilt(self, **kwargs: Any) -> None:
"""Stop the roller."""
await self.roller.move_stop()
@override
async def async_set_cover_tilt_position(self, **kwargs: Any) -> None:
"""Tilt the roller shutter to a specific position."""
await self.roller.move_to(100 - kwargs[ATTR_POSITION])
@@ -1,5 +1,7 @@
"""Base class for Acmeda Roller Blinds."""
from typing import override
import aiopulse
from homeassistant.core import callback
@@ -40,6 +42,7 @@ class AcmedaEntity(entity.Entity):
await self.async_remove(force_remove=True)
@override
async def async_added_to_hass(self) -> None:
"""Entity has been added to hass."""
self.roller.callback_subscribe(self.notify_update)
@@ -52,6 +55,7 @@ class AcmedaEntity(entity.Entity):
)
)
@override
async def async_will_remove_from_hass(self) -> None:
"""Entity being removed from hass."""
self.roller.callback_unsubscribe(self.notify_update)
@@ -62,6 +66,7 @@ class AcmedaEntity(entity.Entity):
LOGGER.debug("Device update notification received: %s", self.name)
self.async_write_ha_state()
@override
@property
def unique_id(self) -> str:
"""Return the unique ID of this roller."""
@@ -72,6 +77,7 @@ class AcmedaEntity(entity.Entity):
"""Return the ID of this roller."""
return self.roller.id # type: ignore[no-any-return]
@override
@property
def device_info(self) -> dr.DeviceInfo:
"""Return the device info."""
@@ -1,5 +1,7 @@
"""Support for Acmeda Roller Blind Batteries."""
from typing import override
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant, callback
@@ -43,6 +45,7 @@ class AcmedaBattery(AcmedaEntity, SensorEntity):
_attr_device_class = SensorDeviceClass.BATTERY
_attr_native_unit_of_measurement = PERCENTAGE
@override
@property
def native_value(self) -> float | int | None:
"""Return the state of the device."""
@@ -1,7 +1,7 @@
"""Support for Actiontec MI424WR (Verizon FIOS) routers."""
import logging
from typing import Final
from typing import Final, override
import telnetlib # pylint: disable=deprecated-module
import voluptuous as vol
@@ -50,11 +50,13 @@ class ActiontecDeviceScanner(DeviceScanner):
data = self.get_actiontec_data()
self.success_init = data is not None
@override
def scan_devices(self) -> list[str]:
"""Scan for new devices and return a list with found device IDs."""
self._update_info()
return [client.mac_address for client in self.last_results]
@override
def get_device_name(self, device: str) -> str | None:
"""Return the name of the given device or None if we don't know."""
for client in self.last_results:
+21 -1
View File
@@ -1,6 +1,6 @@
"""Climate platform for Actron Air integration."""
from typing import Any
from typing import Any, override
from actron_neo_api import ActronAirStatus, ActronAirZone
@@ -93,6 +93,7 @@ class ActronSystemClimate(ActronAirAcEntity, ActronAirClimateEntity):
super().__init__(coordinator)
self._attr_unique_id = self._serial_number
@override
@property
def hvac_modes(self) -> list[HVACMode]:
"""Return the list of supported HVAC modes."""
@@ -104,11 +105,13 @@ class ActronSystemClimate(ActronAirAcEntity, ActronAirClimateEntity):
modes.append(HVACMode.OFF)
return modes
@override
@property
def min_temp(self) -> float:
"""Return the minimum temperature that can be set."""
return self._status.min_temp
@override
@property
def max_temp(self) -> float:
"""Return the maximum temperature that can be set."""
@@ -119,6 +122,7 @@ class ActronSystemClimate(ActronAirAcEntity, ActronAirClimateEntity):
"""Get the current status from the coordinator."""
return self.coordinator.data
@override
@property
def hvac_mode(self) -> HVACMode | None:
"""Return the current HVAC mode."""
@@ -128,39 +132,46 @@ class ActronSystemClimate(ActronAirAcEntity, ActronAirClimateEntity):
mode = self._status.user_aircon_settings.mode
return HVAC_MODE_MAPPING_ACTRONAIR_TO_HA.get(mode)
@override
@property
def fan_mode(self) -> str | None:
"""Return the current fan mode."""
fan_mode = self._status.user_aircon_settings.base_fan_mode
return FAN_MODE_MAPPING_ACTRONAIR_TO_HA.get(fan_mode)
@override
@property
def current_humidity(self) -> float:
"""Return the current humidity."""
return self._status.master_info.live_humidity_pc
@override
@property
def current_temperature(self) -> float:
"""Return the current temperature."""
return self._status.master_info.live_temp_c
@override
@property
def target_temperature(self) -> float:
"""Return the target temperature."""
return self._status.user_aircon_settings.current_setpoint
@override
@actron_air_command
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set a new fan mode."""
api_fan_mode = FAN_MODE_MAPPING_HA_TO_ACTRONAIR[fan_mode]
await self._status.user_aircon_settings.set_fan_mode(api_fan_mode)
@override
@actron_air_command
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC mode."""
ac_mode = HVAC_MODE_MAPPING_HA_TO_ACTRONAIR[hvac_mode]
await self._status.ac_system.set_system_mode(ac_mode)
@override
@actron_air_command
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set the temperature."""
@@ -190,6 +201,7 @@ class ActronZoneClimate(ActronAirZoneEntity, ActronAirClimateEntity):
super().__init__(coordinator, zone)
self._attr_unique_id: str = self._zone_identifier
@override
@property
def hvac_modes(self) -> list[HVACMode]:
"""Return the list of supported HVAC modes."""
@@ -202,11 +214,13 @@ class ActronZoneClimate(ActronAirZoneEntity, ActronAirClimateEntity):
modes.append(HVACMode.OFF)
return modes
@override
@property
def min_temp(self) -> float:
"""Return the minimum temperature that can be set."""
return self._zone.min_temp
@override
@property
def max_temp(self) -> float:
"""Return the maximum temperature that can be set."""
@@ -218,6 +232,7 @@ class ActronZoneClimate(ActronAirZoneEntity, ActronAirClimateEntity):
status = self.coordinator.data
return status.zones[self._zone_id]
@override
@property
def hvac_mode(self) -> HVACMode | None:
"""Return the current HVAC mode."""
@@ -226,27 +241,32 @@ class ActronZoneClimate(ActronAirZoneEntity, ActronAirClimateEntity):
return HVAC_MODE_MAPPING_ACTRONAIR_TO_HA.get(mode)
return HVACMode.OFF
@override
@property
def current_humidity(self) -> float | None:
"""Return the current humidity."""
return self._zone.humidity
@override
@property
def current_temperature(self) -> float | None:
"""Return the current temperature."""
return self._zone.live_temp_c
@override
@property
def target_temperature(self) -> float | None:
"""Return the target temperature."""
return self._zone.current_setpoint
@override
@actron_air_command
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC mode."""
is_enabled = hvac_mode != HVACMode.OFF
await self._zone.enable(is_enabled)
@override
@actron_air_command
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set the temperature."""
@@ -2,7 +2,7 @@
import asyncio
from collections.abc import Mapping
from typing import Any
from typing import Any, override
from actron_neo_api import ActronAirAPI, ActronAirAuthError
@@ -30,6 +30,7 @@ class ActronAirConfigFlow(ConfigFlow, domain=DOMAIN):
self._expires_minutes: str = "30"
self.login_task: asyncio.Task[None] | None = None
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -2,6 +2,7 @@
from dataclasses import dataclass
from datetime import timedelta
from typing import override
from actron_neo_api import (
ActronAirAPI,
@@ -60,6 +61,7 @@ class ActronAirSystemCoordinator(DataUpdateCoordinator[ActronAirStatus]):
self.status = self.api.state_manager.get_status(self.serial_number)
self.last_seen = dt_util.utcnow()
@override
async def _async_update_data(self) -> ActronAirStatus:
"""Fetch updates and merge incremental changes into the full state."""
try:
@@ -2,7 +2,7 @@
from collections.abc import Callable, Coroutine
from functools import wraps
from typing import Any, Concatenate
from typing import Any, Concatenate, override
from actron_neo_api import ActronAirAPIError, ActronAirZone
@@ -49,6 +49,7 @@ class ActronAirEntity(CoordinatorEntity[ActronAirSystemCoordinator]):
super().__init__(coordinator)
self._serial_number = coordinator.serial_number
@override
@property
def available(self) -> bool:
"""Return True if entity is available."""
@@ -2,7 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.const import EntityCategory
@@ -100,16 +100,19 @@ class ActronAirSwitch(ActronAirAcEntity, SwitchEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}_{description.key}"
@override
@property
def is_on(self) -> bool:
"""Return true if the switch is on."""
return self.entity_description.is_on_fn(self.coordinator)
@override
@actron_air_command
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""
await self.entity_description.set_fn(self.coordinator, True)
@override
@actron_air_command
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the switch off."""
+9 -1
View File
@@ -1,6 +1,6 @@
"""Support for Adax wifi-enabled home heaters."""
from typing import Any, cast
from typing import Any, cast, override
from adax import Adax
from adax_local import Adax as AdaxLocal
@@ -81,6 +81,7 @@ class AdaxDevice(CoordinatorEntity[AdaxCloudCoordinator], ClimateEntity):
)
self._apply_data(self.room)
@override
@property
def available(self) -> bool:
"""Whether the entity is available or not."""
@@ -91,6 +92,7 @@ class AdaxDevice(CoordinatorEntity[AdaxCloudCoordinator], ClimateEntity):
"""Gets the data for this particular device."""
return self.coordinator.data[self._device_id]
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set hvac mode."""
if hvac_mode == HVACMode.HEAT:
@@ -108,6 +110,7 @@ class AdaxDevice(CoordinatorEntity[AdaxCloudCoordinator], ClimateEntity):
# Request data refresh from source to verify that update was successful
await self.coordinator.async_request_refresh()
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
@@ -116,6 +119,7 @@ class AdaxDevice(CoordinatorEntity[AdaxCloudCoordinator], ClimateEntity):
self._device_id, temperature, True
)
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
@@ -161,6 +165,7 @@ class LocalAdaxDevice(CoordinatorEntity[AdaxLocalCoordinator], ClimateEntity):
manufacturer="Adax",
)
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set hvac mode."""
if hvac_mode == HVACMode.HEAT:
@@ -179,6 +184,7 @@ class LocalAdaxDevice(CoordinatorEntity[AdaxLocalCoordinator], ClimateEntity):
self._attr_hvac_mode = hvac_mode
self.async_write_ha_state()
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
@@ -210,12 +216,14 @@ class LocalAdaxDevice(CoordinatorEntity[AdaxLocalCoordinator], ClimateEntity):
self._attr_icon = "mdi:radiator"
self._attr_target_temperature = target_temp
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._update_hvac_attributes()
super()._handle_coordinator_update()
@override
async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
+2 -1
View File
@@ -1,7 +1,7 @@
"""Config flow for Adax integration."""
import logging
from typing import Any
from typing import Any, override
import adax
import adax_local
@@ -39,6 +39,7 @@ class AdaxConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 2
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
+3 -1
View File
@@ -1,7 +1,7 @@
"""DataUpdateCoordinator for the Adax component."""
import logging
from typing import Any, cast
from typing import Any, cast, override
from adax import Adax
from adax_local import Adax as AdaxLocal
@@ -39,6 +39,7 @@ class AdaxCloudCoordinator(DataUpdateCoordinator[dict[str, dict[str, Any]]]):
websession=async_get_clientsession(hass),
)
@override
async def _async_update_data(self) -> dict[str, dict[str, Any]]:
"""Fetch data from the Adax."""
try:
@@ -87,6 +88,7 @@ class AdaxLocalCoordinator(DataUpdateCoordinator[dict[str, Any] | None]):
websession=async_get_clientsession(hass, verify_ssl=False),
)
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Fetch data from the Adax."""
if result := await self.adax_data_handler.get_status():
+3 -1
View File
@@ -1,7 +1,7 @@
"""Support for Adax energy sensors."""
from dataclasses import dataclass
from typing import cast
from typing import cast, override
from homeassistant.components.sensor import (
SensorDeviceClass,
@@ -94,6 +94,7 @@ class AdaxSensor(CoordinatorEntity[AdaxCloudCoordinator], SensorEntity):
manufacturer="Adax",
)
@override
@property
def available(self) -> bool:
"""Return True if entity is available."""
@@ -103,6 +104,7 @@ class AdaxSensor(CoordinatorEntity[AdaxCloudCoordinator], SensorEntity):
in self.coordinator.data[self._device_id]
)
@override
@property
def native_value(self) -> int | float | None:
"""Return the native value of the sensor."""
@@ -1,6 +1,6 @@
"""Config flow to configure the AdGuard Home integration."""
from typing import Any
from typing import Any, override
from adguardhome import AdGuardHome, AdGuardHomeConnectionError
import voluptuous as vol
@@ -57,6 +57,7 @@ class AdGuardHomeFlowHandler(ConfigFlow, domain=DOMAIN):
errors=errors or {},
)
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -102,6 +103,7 @@ class AdGuardHomeFlowHandler(ConfigFlow, domain=DOMAIN):
},
)
@override
async def async_step_hassio(
self, discovery_info: HassioServiceInfo
) -> ConfigFlowResult:
@@ -1,5 +1,7 @@
"""AdGuard Home base entity."""
from typing import override
from adguardhome import AdGuardHomeError
from homeassistant.config_entries import SOURCE_HASSIO
@@ -46,6 +48,7 @@ class AdGuardHomeEntity(Entity):
"""Update AdGuard Home entity."""
raise NotImplementedError
@override
@property
def device_info(self) -> DeviceInfo:
"""Return device information about this AdGuard Home instance."""
+2 -1
View File
@@ -3,7 +3,7 @@
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from datetime import timedelta
from typing import Any
from typing import Any, override
from adguardhome import AdGuardHome
@@ -118,6 +118,7 @@ class AdGuardHomeSensor(AdGuardHomeEntity, SensorEntity):
]
)
@override
async def _adguard_update(self) -> None:
"""Update AdGuard Home entity."""
value = await self.entity_description.value_fn(self.adguard)
+4 -1
View File
@@ -3,7 +3,7 @@
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from datetime import timedelta
from typing import Any
from typing import Any, override
from adguardhome import AdGuardHome, AdGuardHomeError
@@ -113,6 +113,7 @@ class AdGuardHomeSwitch(AdGuardHomeEntity, SwitchEntity):
]
)
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the switch."""
try:
@@ -124,6 +125,7 @@ class AdGuardHomeSwitch(AdGuardHomeEntity, SwitchEntity):
translation_key="error_while_turn_off",
) from err
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn on the switch."""
try:
@@ -135,6 +137,7 @@ class AdGuardHomeSwitch(AdGuardHomeEntity, SwitchEntity):
translation_key="error_while_turn_on",
) from err
@override
async def _adguard_update(self) -> None:
"""Update AdGuard Home entity."""
self._attr_is_on = await self.entity_description.is_on_fn(self.adguard)()
+3 -1
View File
@@ -1,7 +1,7 @@
"""AdGuard Home Update platform."""
from datetime import timedelta
from typing import Any
from typing import Any, override
from adguardhome import AdGuardHomeError
@@ -50,6 +50,7 @@ class AdGuardHomeUpdate(AdGuardHomeEntity, UpdateEntity):
[DOMAIN, self.adguard.host, str(self.adguard.port), "update"]
)
@override
async def _adguard_update(self) -> None:
"""Update AdGuard Home entity."""
value = await self.adguard.update.update_available()
@@ -58,6 +59,7 @@ class AdGuardHomeUpdate(AdGuardHomeEntity, UpdateEntity):
self._attr_release_summary = value.announcement
self._attr_release_url = value.announcement_url
@override
async def async_install(
self, version: str | None, backup: bool, **kwargs: Any
) -> None:
@@ -1,5 +1,7 @@
"""Support for ADS binary sensors."""
from typing import override
import pyads
import voluptuous as vol
@@ -60,10 +62,12 @@ class AdsBinarySensor(AdsEntity, BinarySensorEntity):
super().__init__(ads_hub, name, ads_var)
self._attr_device_class = device_class or BinarySensorDeviceClass.MOVING
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_BOOL)
@override
@property
def is_on(self) -> bool:
"""Return True if the entity is on."""
+9 -1
View File
@@ -1,6 +1,6 @@
"""Support for ADS covers."""
from typing import Any
from typing import Any, override
import pyads
import voluptuous as vol
@@ -122,6 +122,7 @@ class AdsCover(AdsEntity, CoverEntity):
if ads_var_pos_set is not None:
self._attr_supported_features |= CoverEntityFeature.SET_POSITION
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
if self._ads_var is not None:
@@ -132,6 +133,7 @@ class AdsCover(AdsEntity, CoverEntity):
self._ads_var_position, pyads.PLCTYPE_BYTE, STATE_KEY_POSITION
)
@override
@property
def is_closed(self) -> bool | None:
"""Return if the cover is closed."""
@@ -141,16 +143,19 @@ class AdsCover(AdsEntity, CoverEntity):
return self._state_dict[STATE_KEY_POSITION] == 0
return None
@override
@property
def current_cover_position(self) -> int:
"""Return current position of cover."""
return self._state_dict[STATE_KEY_POSITION]
@override
def stop_cover(self, **kwargs: Any) -> None:
"""Fire the stop action."""
if self._ads_var_stop:
self._ads_hub.write_by_name(self._ads_var_stop, True, pyads.PLCTYPE_BOOL)
@override
def set_cover_position(self, **kwargs: Any) -> None:
"""Set cover position."""
position = kwargs[ATTR_POSITION]
@@ -159,6 +164,7 @@ class AdsCover(AdsEntity, CoverEntity):
self._ads_var_pos_set, position, pyads.PLCTYPE_BYTE
)
@override
def open_cover(self, **kwargs: Any) -> None:
"""Move the cover up."""
if self._ads_var_open is not None:
@@ -166,6 +172,7 @@ class AdsCover(AdsEntity, CoverEntity):
elif self._ads_var_pos_set is not None:
self.set_cover_position(position=100)
@override
def close_cover(self, **kwargs: Any) -> None:
"""Move the cover down."""
if self._ads_var_close is not None:
@@ -173,6 +180,7 @@ class AdsCover(AdsEntity, CoverEntity):
elif self._ads_var_pos_set is not None:
self.set_cover_position(position=0)
@override
@property
def available(self) -> bool:
"""Return False if state has not been updated yet."""
+2 -1
View File
@@ -3,7 +3,7 @@
import asyncio
from asyncio import timeout
import logging
from typing import Any
from typing import Any, override
from homeassistant.helpers.entity import Entity
@@ -64,6 +64,7 @@ class AdsEntity(Entity):
except TimeoutError:
_LOGGER.debug("Variable %s: Timeout during first update", ads_var)
@override
@property
def available(self) -> bool:
"""Return False if state has not been updated yet."""
+7 -1
View File
@@ -1,6 +1,6 @@
"""Support for ADS light sources."""
from typing import Any
from typing import Any, override
import pyads
import voluptuous as vol
@@ -120,6 +120,7 @@ class AdsLight(AdsEntity, LightEntity):
else DEFAULT_MAX_KELVIN
)
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_BOOL)
@@ -138,21 +139,25 @@ class AdsLight(AdsEntity, LightEntity):
STATE_KEY_COLOR_TEMP_KELVIN,
)
@override
@property
def brightness(self) -> int | None:
"""Return the brightness of the light (0..255)."""
return self._state_dict[STATE_KEY_BRIGHTNESS]
@override
@property
def color_temp_kelvin(self) -> int | None:
"""Return the color temperature in Kelvin."""
return self._state_dict[STATE_KEY_COLOR_TEMP_KELVIN]
@override
@property
def is_on(self) -> bool:
"""Return True if the entity is on."""
return self._state_dict[STATE_KEY_STATE]
@override
def turn_on(self, **kwargs: Any) -> None:
"""Turn the light on or set a specific dimmer value."""
brightness = kwargs.get(ATTR_BRIGHTNESS)
@@ -170,6 +175,7 @@ class AdsLight(AdsEntity, LightEntity):
self._ads_var_color_temp_kelvin, color_temp, pyads.PLCTYPE_UINT
)
@override
def turn_off(self, **kwargs: Any) -> None:
"""Turn the light off."""
self._ads_hub.write_by_name(self._ads_var, False, pyads.PLCTYPE_BOOL)
+4
View File
@@ -1,5 +1,7 @@
"""Support for ADS select entities."""
from typing import override
import pyads
import voluptuous as vol
@@ -64,6 +66,7 @@ class AdsSelect(AdsEntity, SelectEntity):
self._attr_options = options
self._attr_current_option = None
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_INT)
@@ -71,6 +74,7 @@ class AdsSelect(AdsEntity, SelectEntity):
self._ads_var, pyads.PLCTYPE_INT, self._handle_ads_value
)
@override
def select_option(self, option: str) -> None:
"""Change the selected option."""
if option in self._attr_options:
+4
View File
@@ -1,5 +1,7 @@
"""Support for ADS sensors."""
from typing import override
import voluptuous as vol
from homeassistant.components.sensor import (
@@ -108,6 +110,7 @@ class AdsSensor(AdsEntity, SensorEntity):
self._attr_state_class = state_class
self._attr_native_unit_of_measurement = unit_of_measurement
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(
@@ -117,6 +120,7 @@ class AdsSensor(AdsEntity, SensorEntity):
self._factor,
)
@override
@property
def native_value(self) -> StateType:
"""Return the state of the device."""
+5 -1
View File
@@ -1,6 +1,6 @@
"""Support for ADS switch platform."""
from typing import Any
from typing import Any, override
import pyads
import voluptuous as vol
@@ -46,19 +46,23 @@ def setup_platform(
class AdsSwitch(AdsEntity, SwitchEntity):
"""Representation of an ADS switch device."""
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_BOOL)
@override
@property
def is_on(self) -> bool:
"""Return True if the entity is on."""
return self._state_dict[STATE_KEY_STATE]
@override
def turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""
self._ads_hub.write_by_name(self._ads_var, True, pyads.PLCTYPE_BOOL)
@override
def turn_off(self, **kwargs: Any) -> None:
"""Turn the switch off."""
self._ads_hub.write_by_name(self._ads_var, False, pyads.PLCTYPE_BOOL)
+5
View File
@@ -1,5 +1,7 @@
"""Support for ADS valves."""
from typing import override
import pyads
import voluptuous as vol
@@ -67,15 +69,18 @@ class AdsValve(AdsEntity, ValveEntity):
self._attr_reports_position = False
self._attr_is_closed = True
@override
async def async_added_to_hass(self) -> None:
"""Register device notification."""
await self.async_initialize_device(self._ads_var, pyads.PLCTYPE_BOOL)
@override
def open_valve(self, **kwargs) -> None:
"""Open the valve."""
self._ads_hub.write_by_name(self._ads_var, True, pyads.PLCTYPE_BOOL)
self._attr_is_closed = False
@override
def close_valve(self, **kwargs) -> None:
"""Close the valve."""
self._ads_hub.write_by_name(self._ads_var, False, pyads.PLCTYPE_BOOL)
@@ -1,5 +1,7 @@
"""Binary Sensor platform for Advantage Air integration."""
from typing import override
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
@@ -54,6 +56,7 @@ class AdvantageAirFilter(AdvantageAirAcEntity, BinarySensorEntity):
super().__init__(coordinator, ac_key)
self._attr_unique_id += "-filter"
@override
@property
def is_on(self) -> bool:
"""Return if filter needs cleaning."""
@@ -73,6 +76,7 @@ class AdvantageAirZoneMotion(AdvantageAirZoneEntity, BinarySensorEntity):
self._attr_name = f"{self._zone['name']} motion"
self._attr_unique_id += "-motion"
@override
@property
def is_on(self) -> bool:
"""Return if motion is detect."""
@@ -93,6 +97,7 @@ class AdvantageAirZoneMyZone(AdvantageAirZoneEntity, BinarySensorEntity):
self._attr_name = f"{self._zone['name']} myZone"
self._attr_unique_id += "-myzone"
@override
@property
def is_on(self) -> bool:
"""Return if this zone is the myZone."""
@@ -2,7 +2,7 @@
from decimal import Decimal
import logging
from typing import Any
from typing import Any, override
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
@@ -155,12 +155,14 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
SUPPORTED_FEATURES_MYZONE | self._support_preset
)
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._async_configure_preset()
super()._handle_coordinator_update()
@override
@property
def current_temperature(self) -> float | None:
"""Return the selected zones current temperature."""
@@ -168,6 +170,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
return self._myzone["measuredTemp"]
return None
@override
@property
def target_temperature(self) -> float | None:
"""Return the current target temperature."""
@@ -177,6 +180,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
return self._myzone["setTemp"]
return self._ac["setTemp"]
@override
@property
def hvac_mode(self) -> HVACMode | None:
"""Return the current HVAC modes."""
@@ -184,6 +188,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
return ADVANTAGE_AIR_HVAC_MODES.get(self._ac["mode"])
return HVACMode.OFF
@override
@property
def hvac_action(self) -> HVACAction | None:
"""Return the current running HVAC action."""
@@ -195,25 +200,30 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
)
return HVAC_ACTIONS.get(self._ac["mode"])
@override
@property
def fan_mode(self) -> str | None:
"""Return the current fan modes."""
return FAN_AUTO if self._ac["fan"] == ADVANTAGE_AIR_MYFAN else self._ac["fan"]
@override
@property
def target_temperature_high(self) -> float | None:
"""Return the temperature cool mode is enabled."""
return self._ac.get(ADVANTAGE_AIR_COOL_TARGET)
@override
@property
def target_temperature_low(self) -> float | None:
"""Return the temperature heat mode is enabled."""
return self._ac.get(ADVANTAGE_AIR_HEAT_TARGET)
@override
async def async_turn_on(self) -> None:
"""Set the HVAC State to on."""
await self.async_update_ac({"state": ADVANTAGE_AIR_STATE_ON})
@override
async def async_turn_off(self) -> None:
"""Set the HVAC State to off."""
await self.async_update_ac(
@@ -222,6 +232,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
}
)
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC Mode and State."""
if hvac_mode == HVACMode.OFF:
@@ -236,6 +247,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
}
)
@override
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set the Fan Mode."""
if fan_mode == FAN_AUTO and self._ac.get(ADVANTAGE_AIR_AUTOFAN_ENABLED):
@@ -244,6 +256,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
mode = fan_mode
await self.async_update_ac({"fan": mode})
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set the Temperature."""
if ATTR_TEMPERATURE in kwargs:
@@ -256,6 +269,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
}
)
@override
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set the preset mode."""
change = {}
@@ -288,6 +302,7 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
super().__init__(coordinator, ac_key, zone_key)
self._attr_name = self._zone["name"]
@override
@property
def hvac_mode(self) -> HVACMode:
"""Return the current state as HVAC mode."""
@@ -295,6 +310,7 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
return HVACMode.HEAT_COOL
return HVACMode.OFF
@override
@property
def hvac_action(self) -> HVACAction | None:
"""Return the HVAC action.
@@ -315,24 +331,29 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
return master_action
return HVACAction.OFF
@override
@property
def current_temperature(self) -> float | None:
"""Return the current temperature."""
return self._zone["measuredTemp"]
@override
@property
def target_temperature(self) -> float:
"""Return the target temperature."""
return self._zone["setTemp"]
@override
async def async_turn_on(self) -> None:
"""Set the HVAC State to on."""
await self.async_update_zone({"state": ADVANTAGE_AIR_STATE_OPEN})
@override
async def async_turn_off(self) -> None:
"""Set the HVAC State to off."""
await self.async_update_zone({"state": ADVANTAGE_AIR_STATE_CLOSE})
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC Mode and State."""
if hvac_mode == HVACMode.OFF:
@@ -340,6 +361,7 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
else:
await self.async_turn_on()
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set the Temperature."""
temp = kwargs.get(ATTR_TEMPERATURE)
@@ -1,6 +1,6 @@
"""Config Flow for Advantage Air integration."""
from typing import Any
from typing import Any, override
from advantage_air import ApiError, advantage_air
import voluptuous as vol
@@ -28,6 +28,7 @@ class AdvantageAirConfigFlow(ConfigFlow, domain=DOMAIN):
DOMAIN = DOMAIN
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -2,7 +2,7 @@
from datetime import timedelta
import logging
from typing import Any
from typing import Any, override
from advantage_air import ApiError, advantage_air
@@ -45,6 +45,7 @@ class AdvantageAirCoordinator(DataUpdateCoordinator[dict[str, Any]]):
)
self.api = api
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Fetch data from the API."""
try:
@@ -1,6 +1,6 @@
"""Cover platform for Advantage Air integration."""
from typing import Any
from typing import Any, override
from homeassistant.components.cover import (
ATTR_POSITION,
@@ -65,11 +65,13 @@ class AdvantageAirZoneVent(AdvantageAirZoneEntity, CoverEntity):
super().__init__(coordinator, ac_key, zone_key)
self._attr_name = self._zone["name"]
@override
@property
def is_closed(self) -> bool:
"""Return if vent is fully closed."""
return self._zone["state"] == ADVANTAGE_AIR_STATE_CLOSE
@override
@property
def current_cover_position(self) -> int:
"""Return vents current position as a percentage."""
@@ -77,16 +79,19 @@ class AdvantageAirZoneVent(AdvantageAirZoneEntity, CoverEntity):
return self._zone["value"]
return 0
@override
async def async_open_cover(self, **kwargs: Any) -> None:
"""Fully open zone vent."""
await self.async_update_zone(
{"state": ADVANTAGE_AIR_STATE_OPEN, "value": 100},
)
@override
async def async_close_cover(self, **kwargs: Any) -> None:
"""Fully close zone vent."""
await self.async_update_zone({"state": ADVANTAGE_AIR_STATE_CLOSE})
@override
async def async_set_cover_position(self, **kwargs: Any) -> None:
"""Change vent position."""
position = round(kwargs[ATTR_POSITION] / 5) * 5
@@ -116,15 +121,18 @@ class AdvantageAirThingCover(AdvantageAirThingEntity, CoverEntity):
super().__init__(coordinator, thing)
self._attr_device_class = device_class
@override
@property
def is_closed(self) -> bool:
"""Return if cover is fully closed."""
return self._data["value"] == 0
@override
async def async_open_cover(self, **kwargs: Any) -> None:
"""Fully open zone vent."""
return await self.async_turn_on()
@override
async def async_close_cover(self, **kwargs: Any) -> None:
"""Fully close zone vent."""
return await self.async_turn_off()
@@ -1,6 +1,6 @@
"""Light platform for Advantage Air integration."""
from typing import Any
from typing import Any, override
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.core import HomeAssistant
@@ -69,15 +69,18 @@ class AdvantageAirLight(AdvantageAirEntity, LightEntity):
"""Return the light object."""
return self.coordinator.data["myLights"]["lights"][self._id]
@override
@property
def is_on(self) -> bool:
"""Return if the light is on."""
return self._data["state"] == ADVANTAGE_AIR_STATE_ON
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the light on."""
await self.async_update_state(True)
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the light off."""
await self.async_update_state(False)
@@ -98,11 +101,13 @@ class AdvantageAirLightDimmable(AdvantageAirLight):
coordinator.api.lights.async_update_value, self._id
)
@override
@property
def brightness(self) -> int:
"""Return the brightness of this light between 0..255."""
return round(self._data["value"] * 255 / 100)
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the light on and optionally set the brightness."""
if ATTR_BRIGHTNESS in kwargs:
@@ -123,11 +128,13 @@ class AdvantageAirThingLightDimmable(AdvantageAirThingEntity, LightEntity):
_attr_color_mode = ColorMode.BRIGHTNESS
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
@override
@property
def brightness(self) -> int:
"""Return the brightness of this light between 0..255."""
return round(self._data["value"] * 255 / 100)
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the light on by setting the brightness."""
await self.async_update_value(round(kwargs.get(ATTR_BRIGHTNESS, 255) / 2.55))
@@ -1,5 +1,7 @@
"""Select platform for Advantage Air integration."""
from typing import override
from homeassistant.components.select import SelectEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -47,11 +49,13 @@ class AdvantageAirMyZone(AdvantageAirAcEntity, SelectEntity):
self._number_to_name[zone["number"]] = zone["name"]
self._attr_options.append(zone["name"])
@override
@property
def current_option(self) -> str:
"""Return the current MyZone."""
return self._number_to_name[self._ac["myZone"]]
@override
async def async_select_option(self, option: str) -> None:
"""Set the MyZone."""
await self.async_update_ac({"myZone": self._name_to_number[option]})
@@ -1,7 +1,7 @@
"""Sensor platform for Advantage Air integration."""
from decimal import Decimal
from typing import Any
from typing import Any, override
from homeassistant.components.sensor import (
SensorDeviceClass,
@@ -66,11 +66,13 @@ class AdvantageAirTimeTo(AdvantageAirAcEntity, SensorEntity):
self._attr_name = f"Time to {action}"
self._attr_unique_id += f"-timeto{action}"
@override
@property
def native_value(self) -> Decimal:
"""Return the current value."""
return self._ac[self._time_key]
@override
@property
def icon(self) -> str:
"""Return a representative icon of the timer."""
@@ -99,6 +101,7 @@ class AdvantageAirZoneVent(AdvantageAirZoneEntity, SensorEntity):
self._attr_name = f"{self._zone['name']} vent"
self._attr_unique_id += "-vent"
@override
@property
def native_value(self) -> Decimal:
"""Return the current value of the air vent."""
@@ -106,6 +109,7 @@ class AdvantageAirZoneVent(AdvantageAirZoneEntity, SensorEntity):
return self._zone["value"]
return Decimal(0)
@override
@property
def icon(self) -> str:
"""Return a representative icon."""
@@ -129,11 +133,13 @@ class AdvantageAirZoneSignal(AdvantageAirZoneEntity, SensorEntity):
self._attr_name = f"{self._zone['name']} signal"
self._attr_unique_id += "-signal"
@override
@property
def native_value(self) -> Decimal:
"""Return the current value of the wireless signal."""
return self._zone["rssi"]
@override
@property
def icon(self) -> str:
"""Return a representative icon."""
@@ -165,6 +171,7 @@ class AdvantageAirZoneTemp(AdvantageAirZoneEntity, SensorEntity):
self._attr_name = f"{self._zone['name']} temperature"
self._attr_unique_id += "-temp"
@override
@property
def native_value(self) -> Decimal:
"""Return the current value of the measured temperature."""
@@ -1,6 +1,6 @@
"""Switch platform for Advantage Air integration."""
from typing import Any
from typing import Any, override
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
from homeassistant.core import HomeAssistant
@@ -56,15 +56,18 @@ class AdvantageAirFreshAir(AdvantageAirAcEntity, SwitchEntity):
super().__init__(coordinator, ac_key)
self._attr_unique_id += "-freshair"
@override
@property
def is_on(self) -> bool:
"""Return the fresh air status."""
return self._ac["freshAirStatus"] == ADVANTAGE_AIR_STATE_ON
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn fresh air on."""
await self.async_update_ac({"freshAirStatus": ADVANTAGE_AIR_STATE_ON})
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn fresh air off."""
await self.async_update_ac({"freshAirStatus": ADVANTAGE_AIR_STATE_OFF})
@@ -82,15 +85,18 @@ class AdvantageAirMyFan(AdvantageAirAcEntity, SwitchEntity):
super().__init__(coordinator, ac_key)
self._attr_unique_id += "-myfan"
@override
@property
def is_on(self) -> bool:
"""Return the MyFan status."""
return self._ac[ADVANTAGE_AIR_AUTOFAN_ENABLED]
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn MyFan on."""
await self.async_update_ac({ADVANTAGE_AIR_AUTOFAN_ENABLED: True})
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn MyFan off."""
await self.async_update_ac({ADVANTAGE_AIR_AUTOFAN_ENABLED: False})
@@ -108,15 +114,18 @@ class AdvantageAirNightMode(AdvantageAirAcEntity, SwitchEntity):
super().__init__(coordinator, ac_key)
self._attr_unique_id += "-nightmode"
@override
@property
def is_on(self) -> bool:
"""Return the Night Mode status."""
return self._ac[ADVANTAGE_AIR_NIGHT_MODE_ENABLED]
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn Night Mode on."""
await self.async_update_ac({ADVANTAGE_AIR_NIGHT_MODE_ENABLED: True})
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn Night Mode off."""
await self.async_update_ac({ADVANTAGE_AIR_NIGHT_MODE_ENABLED: False})
@@ -1,5 +1,7 @@
"""Advantage Air Update platform."""
from typing import override
from homeassistant.components.update import UpdateEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
@@ -39,11 +41,13 @@ class AdvantageAirApp(AdvantageAirEntity, UpdateEntity):
sw_version=self.coordinator.data["system"]["myAppRev"],
)
@override
@property
def installed_version(self) -> str:
"""Return the current app version."""
return self.coordinator.data["system"]["myAppRev"]
@override
@property
def latest_version(self) -> str:
"""Return if there is an update."""
@@ -1,6 +1,6 @@
"""Config flow for AEMET OpenData."""
from typing import Any
from typing import Any, override
from aemet_opendata.exceptions import AuthError
from aemet_opendata.interface import AEMET, ConnectionOptions
@@ -31,6 +31,7 @@ OPTIONS_FLOW = {
class AemetConfigFlow(ConfigFlow, domain=DOMAIN):
"""Config flow for AEMET OpenData."""
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -80,6 +81,7 @@ class AemetConfigFlow(ConfigFlow, domain=DOMAIN):
},
)
@override
@staticmethod
@callback
def async_get_options_flow(
@@ -4,7 +4,7 @@ from asyncio import timeout
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Any, Final, cast
from typing import Any, Final, cast, override
from aemet_opendata.const import (
AOD_CONDITION,
@@ -60,6 +60,7 @@ class WeatherUpdateCoordinator(DataUpdateCoordinator):
update_interval=WEATHER_UPDATE_INTERVAL,
)
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Update coordinator data."""
async with timeout(API_TIMEOUT):
+2 -1
View File
@@ -1,6 +1,6 @@
"""Support for the AEMET OpenData images."""
from typing import Final
from typing import Final, override
from aemet_opendata.const import AOD_DATETIME, AOD_IMG_BYTES, AOD_IMG_TYPE, AOD_RADAR
from aemet_opendata.helpers import dict_nested_value
@@ -67,6 +67,7 @@ class AemetImage(AemetEntity, ImageEntity):
self._async_update_attrs()
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Update attributes when the coordinator updates."""
+2 -1
View File
@@ -3,7 +3,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime
from typing import Final
from typing import Final, override
from aemet_opendata.const import (
AOD_CONDITION,
@@ -398,6 +398,7 @@ class AemetSensor(AemetEntity, SensorEntity):
self.entity_description = description
self._attr_unique_id = f"{unique_id}-{description.key}"
@override
@property
def native_value(self):
"""Return the state of the device."""
+11
View File
@@ -1,5 +1,7 @@
"""Support for the AEMET OpenData service."""
from typing import override
from aemet_opendata.const import (
AOD_CONDITION,
AOD_FORECAST_DAILY,
@@ -73,47 +75,56 @@ class AemetWeather(
super().__init__(coordinator, name, unique_id)
self._attr_unique_id = unique_id
@override
@property
def condition(self) -> str | None:
"""Return the current condition."""
cond = self.get_aemet_value([AOD_WEATHER, AOD_CONDITION])
return CONDITIONS_MAP.get(cond)
@override
@callback
def _async_forecast_daily(self) -> list[Forecast]:
"""Return the daily forecast in native units."""
return self.get_aemet_forecast(AOD_FORECAST_DAILY)
@override
@callback
def _async_forecast_hourly(self) -> list[Forecast]:
"""Return the hourly forecast in native units."""
return self.get_aemet_forecast(AOD_FORECAST_HOURLY)
@override
@property
def humidity(self) -> float | None:
"""Return the humidity."""
return self.get_aemet_value([AOD_WEATHER, AOD_HUMIDITY])
@override
@property
def native_pressure(self) -> float | None:
"""Return the pressure."""
return self.get_aemet_value([AOD_WEATHER, AOD_PRESSURE])
@override
@property
def native_temperature(self) -> float | None:
"""Return the temperature."""
return self.get_aemet_value([AOD_WEATHER, AOD_TEMP])
@override
@property
def wind_bearing(self) -> float | None:
"""Return the wind bearing."""
return self.get_aemet_value([AOD_WEATHER, AOD_WIND_DIRECTION])
@override
@property
def native_wind_gust_speed(self) -> float | None:
"""Return the wind gust speed in native units."""
return self.get_aemet_value([AOD_WEATHER, AOD_WIND_SPEED_MAX])
@override
@property
def native_wind_speed(self) -> float | None:
"""Return the wind speed."""
@@ -1,7 +1,7 @@
"""Config flow for AfterShip integration."""
import logging
from typing import Any
from typing import Any, override
from pyaftership import AfterShip, AfterShipException
import voluptuous as vol
@@ -20,6 +20,7 @@ class AfterShipConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 1
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
+4 -1
View File
@@ -1,7 +1,7 @@
"""Support for non-delivered packages recorded in AfterShip."""
import logging
from typing import Any, Final
from typing import Any, Final, override
from pyaftership import AfterShip, AfterShipException
@@ -95,16 +95,19 @@ class AfterShipSensor(SensorEntity):
self.aftership = aftership
self._attr_name = name
@override
@property
def native_value(self) -> int | None:
"""Return the state of the sensor."""
return self._state
@override
@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return attributes for the sensor."""
return self._attributes
@override
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
self.async_on_remove(
@@ -1,5 +1,7 @@
"""Support for Agent DVR Alarm Control Panels."""
from typing import override
from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntity,
AlarmControlPanelEntityFeature,
@@ -70,23 +72,27 @@ class AgentBaseStation(AlarmControlPanelEntity):
else:
self._attr_alarm_state = AlarmControlPanelState.DISARMED
@override
async def async_alarm_disarm(self, code: str | None = None) -> None:
"""Send disarm command."""
await self._client.disarm()
self._attr_alarm_state = AlarmControlPanelState.DISARMED
@override
async def async_alarm_arm_away(self, code: str | None = None) -> None:
"""Send arm away command. Uses custom mode."""
await self._client.arm()
await self._client.set_active_profile(CONF_AWAY_MODE_NAME)
self._attr_alarm_state = AlarmControlPanelState.ARMED_AWAY
@override
async def async_alarm_arm_home(self, code: str | None = None) -> None:
"""Send arm home command. Uses custom mode."""
await self._client.arm()
await self._client.set_active_profile(CONF_HOME_MODE_NAME)
self._attr_alarm_state = AlarmControlPanelState.ARMED_HOME
@override
async def async_alarm_arm_night(self, code: str | None = None) -> None:
"""Send arm night command. Uses custom mode."""
await self._client.arm()
@@ -2,6 +2,7 @@
from datetime import timedelta
import logging
from typing import override
from agent import AgentError
@@ -94,6 +95,7 @@ class AgentCamera(MjpegCamera):
"alerts_enabled": self.device.alerts_active,
}
@override
@property
def is_recording(self) -> bool:
"""Return whether the monitor is recording."""
@@ -114,11 +116,13 @@ class AgentCamera(MjpegCamera):
"""Return True if entity is connected."""
return self.device.connected
@override
@property
def is_on(self) -> bool:
"""Return true if on."""
return self.device.online
@override
@property
def motion_detection_enabled(self) -> bool:
"""Return the camera motion detection status."""
@@ -132,10 +136,12 @@ class AgentCamera(MjpegCamera):
"""Disable alerts."""
await self.device.alerts_off()
@override
async def async_enable_motion_detection(self) -> None:
"""Enable motion detection."""
await self.device.detector_on()
@override
async def async_disable_motion_detection(self) -> None:
"""Disable motion detection."""
await self.device.detector_off()
@@ -148,6 +154,7 @@ class AgentCamera(MjpegCamera):
"""Stop recording."""
await self.device.record_stop()
@override
async def async_turn_on(self) -> None:
"""Enable the camera."""
await self.device.enable()
@@ -156,6 +163,7 @@ class AgentCamera(MjpegCamera):
"""Take a snapshot."""
await self.device.snapshot()
@override
async def async_turn_off(self) -> None:
"""Disable the camera."""
await self.device.disable()
@@ -1,7 +1,7 @@
"""Config flow to configure Agent devices."""
from contextlib import suppress
from typing import Any
from typing import Any, override
from agent import AgentConnectionError, AgentError
from agent.a import Agent
@@ -20,6 +20,7 @@ DEFAULT_PORT = 8090
class AgentFlowHandler(ConfigFlow, domain=DOMAIN):
"""Handle an Agent config flow."""
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
+4 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import AsyncGenerator
import contextlib
from typing import final
from typing import final, override
from propcache.api import cached_property
@@ -28,6 +28,7 @@ class AITaskEntity(RestoreEntity):
_attr_supported_features = AITaskEntityFeature(0)
__last_activity: str | None = None
@override
@property
@final
def state(self) -> str | None:
@@ -36,11 +37,13 @@ class AITaskEntity(RestoreEntity):
return None
return self.__last_activity
@override
@cached_property
def supported_features(self) -> AITaskEntityFeature:
"""Flag supported features."""
return self._attr_supported_features
@override
async def async_internal_added_to_hass(self) -> None:
"""Call when the entity is added to hass."""
await super().async_internal_added_to_hass()
+3 -1
View File
@@ -6,7 +6,7 @@ import io
import mimetypes
from pathlib import Path
import tempfile
from typing import Any
from typing import Any, override
import voluptuous as vol
@@ -260,6 +260,7 @@ class GenDataTask:
llm_api: llm.API | None = None
"""API to provide to the LLM."""
@override
def __str__(self) -> str:
"""Return task as a string."""
return f"<GenDataTask {self.name}: {id(self)}>"
@@ -296,6 +297,7 @@ class GenImageTask:
attachments: list[conversation.Attachment] | None = None
"""List of attachments to go along the instructions."""
@override
def __str__(self) -> str:
"""Return task as a string."""
return f"<GenImageTask {self.name}: {id(self)}>"
@@ -1,6 +1,6 @@
"""Config flow for Aidot integration."""
from typing import Any
from typing import Any, override
from aidot.client import AidotClient
from aidot.const import CONF_ID, DEFAULT_COUNTRY_CODE, SUPPORTED_COUNTRY_CODES
@@ -34,6 +34,7 @@ DATA_SCHEMA = vol.Schema(
class AidotConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle aidot config flow."""
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -2,6 +2,7 @@
from datetime import timedelta
import logging
from typing import override
from aidot.client import AidotClient
from aidot.const import (
@@ -48,6 +49,7 @@ class AidotDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceStatusData]):
)
self.device_client = device_client
@override
async def _async_setup(self) -> None:
"""Set up the coordinator."""
self.device_client.on_status_update = self._handle_status_update
@@ -56,6 +58,7 @@ class AidotDeviceUpdateCoordinator(DataUpdateCoordinator[DeviceStatusData]):
"""Handle status callback."""
self.async_set_updated_data(status)
@override
async def _async_update_data(self) -> DeviceStatusData:
"""Return current status."""
return self.device_client.status
@@ -86,6 +89,7 @@ class AidotDeviceManagerCoordinator(DataUpdateCoordinator[None]):
self.client.set_token_fresh_cb(self.token_fresh_cb)
self.device_coordinators: dict[str, AidotDeviceUpdateCoordinator] = {}
@override
async def _async_setup(self) -> None:
"""Set up the coordinator."""
try:
@@ -93,6 +97,7 @@ class AidotDeviceManagerCoordinator(DataUpdateCoordinator[None]):
except AidotUserOrPassIncorrect as error:
raise ConfigEntryError from error
@override
async def _async_update_data(self) -> None:
"""Update data async."""
try:
+5 -1
View File
@@ -1,6 +1,6 @@
"""Support for Aidot lights."""
from typing import Any
from typing import Any, override
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
@@ -77,17 +77,20 @@ class AidotLight(CoordinatorEntity[AidotDeviceUpdateCoordinator], LightEntity):
self._attr_color_temp_kelvin = self.coordinator.data.cct
self._attr_rgbw_color = self.coordinator.data.rgbw
@override
@property
def available(self) -> bool:
"""Return if entity is available."""
return super().available and self.coordinator.data.online
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Update."""
self._update_status()
super()._handle_coordinator_update()
@override
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the light on, applying brightness, color temperature, RGBW, or plain on."""
if ATTR_BRIGHTNESS in kwargs:
@@ -114,6 +117,7 @@ class AidotLight(CoordinatorEntity[AidotDeviceUpdateCoordinator], LightEntity):
self._attr_is_on = True
self.async_write_ha_state()
@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the light off."""
await self.coordinator.device_client.async_turn_off()
@@ -2,7 +2,7 @@
from datetime import timedelta
import logging
from typing import Final, final
from typing import Final, final, override
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONCENTRATION_MICROGRAMS_PER_CUBIC_METER
@@ -129,6 +129,7 @@ class AirQualityEntity(Entity):
"""Return the NO2 (nitrogen dioxide) level."""
return None
@override
@final
@property
def state_attributes(self) -> dict[str, str | int | float]:
@@ -141,11 +142,13 @@ class AirQualityEntity(Entity):
return data
@override
@property
def state(self) -> StateType:
"""Return the current state."""
return self.particulate_matter_2_5
@override
@property
def unit_of_measurement(self) -> str:
"""Return the unit of measurement of this entity."""
@@ -2,6 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import override
from airgradient import AirGradientClient, ConfigurationControl
@@ -102,6 +103,7 @@ class AirGradientButton(AirGradientEntity, ButtonEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@override
@exception_handler
async def async_press(self) -> None:
"""Press the button."""
@@ -1,7 +1,7 @@
"""Config flow for Airgradient."""
from collections.abc import Mapping
from typing import Any
from typing import Any, override
from airgradient import (
AirGradientClient,
@@ -42,6 +42,7 @@ class AirGradientConfigFlow(ConfigFlow, domain=DOMAIN):
if config.configuration_control is ConfigurationControl.NOT_INITIALIZED:
await self.client.set_configuration_control(ConfigurationControl.LOCAL)
@override
async def async_step_zeroconf(
self, discovery_info: ZeroconfServiceInfo
) -> ConfigFlowResult:
@@ -83,6 +84,7 @@ class AirGradientConfigFlow(ConfigFlow, domain=DOMAIN):
},
)
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -2,6 +2,7 @@
from dataclasses import dataclass
from datetime import timedelta
from typing import override
from airgradient import AirGradientClient, AirGradientError, Config, Measures
@@ -47,6 +48,7 @@ class AirGradientCoordinator(DataUpdateCoordinator[AirGradientData]):
assert self.config_entry.unique_id
self.serial_number = self.config_entry.unique_id
@override
async def _async_setup(self) -> None:
"""Set up the coordinator."""
try:
@@ -60,6 +62,7 @@ class AirGradientCoordinator(DataUpdateCoordinator[AirGradientData]):
translation_placeholders={"error": str(error)},
) from error
@override
async def _async_update_data(self) -> AirGradientData:
try:
measures = await self.client.get_current_measures()
@@ -2,6 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import override
from airgradient import AirGradientClient, Config
from airgradient.models import ConfigurationControl
@@ -118,11 +119,13 @@ class AirGradientNumber(AirGradientEntity, NumberEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@override
@property
def native_value(self) -> int | None:
"""Return the state of the number."""
return self.entity_description.value_fn(self.coordinator.data.config)
@override
@exception_handler
async def async_set_native_value(self, value: float) -> None:
"""Set the selected value."""
@@ -2,6 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import override
from airgradient import AirGradientClient, Config
from airgradient.models import ConfigurationControl, LedBarMode, TemperatureUnit
@@ -214,11 +215,13 @@ class AirGradientSelect(AirGradientEntity, SelectEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@override
@property
def current_option(self) -> str | None:
"""Return the state of the select."""
return self.entity_description.value_fn(self.coordinator.data.config)
@override
@exception_handler
async def async_select_option(self, option: str) -> None:
"""Change the selected option."""
@@ -2,6 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import override
from airgradient import Config
from airgradient.models import (
@@ -294,6 +295,7 @@ class AirGradientMeasurementSensor(AirGradientSensor):
entity_description: AirGradientMeasurementSensorEntityDescription
@override
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
@@ -317,6 +319,7 @@ class AirGradientConfigSensor(AirGradientSensor):
is not ConfigurationControl.LOCAL
)
@override
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
@@ -2,7 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from airgradient import AirGradientClient, Config
from airgradient.models import ConfigurationControl
@@ -96,17 +96,20 @@ class AirGradientSwitch(AirGradientEntity, SwitchEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@override
@property
def is_on(self) -> bool:
"""Return the state of the switch."""
return self.entity_description.value_fn(self.coordinator.data.config)
@override
@exception_handler
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""
await self.entity_description.set_value_fn(self.coordinator.client, True)
await self.coordinator.async_request_refresh()
@override
@exception_handler
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the switch off."""
@@ -2,6 +2,7 @@
from datetime import timedelta
import logging
from typing import override
from airgradient import AirGradientConnectionError
from propcache.api import cached_property
@@ -41,21 +42,25 @@ class AirGradientUpdate(AirGradientEntity, UpdateEntity):
super().__init__(coordinator)
self._attr_unique_id = f"{coordinator.serial_number}-update"
@override
@cached_property
def should_poll(self) -> bool:
"""Return True because we need to poll the latest version."""
return True
@override
@property
def installed_version(self) -> str:
"""Return the installed version of the entity."""
return self.coordinator.data.measures.firmware_version
@override
@property
def available(self) -> bool:
"""Return if entity is available."""
return super().available and self._attr_available
@override
async def async_update(self) -> None:
"""Update the entity."""
try:
@@ -2,7 +2,7 @@
from asyncio import timeout
from http import HTTPStatus
from typing import Any
from typing import Any, override
from aiohttp import ClientSession
from airly import Airly
@@ -26,6 +26,7 @@ class AirlyFlowHandler(ConfigFlow, domain=DOMAIN):
VERSION = 1
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -4,6 +4,7 @@ from asyncio import timeout
from datetime import timedelta
import logging
from math import ceil
from typing import override
from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
@@ -90,6 +91,7 @@ class AirlyDataUpdateCoordinator(DataUpdateCoordinator[dict[str, str | float | i
update_interval=update_interval,
)
@override
async def _async_update_data(self) -> dict[str, str | float | int]:
"""Update data via library."""
data: dict[str, str | float | int] = {}
+2 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from homeassistant.components.sensor import (
SensorDeviceClass,
@@ -223,6 +223,7 @@ class AirlySensor(CoordinatorEntity[AirlyDataUpdateCoordinator], SensorEntity):
self._attr_extra_state_attributes = description.attrs(coordinator.data)
self.entity_description = description
@override
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
@@ -1,7 +1,7 @@
"""Config flow for AirNow integration."""
import logging
from typing import Any
from typing import Any, override
from pyairnow import WebServiceAPI
from pyairnow.errors import AirNowError, EmptyResponseError, InvalidKeyError
@@ -63,6 +63,7 @@ class AirNowConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 2
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -120,6 +121,7 @@ class AirNowConfigFlow(ConfigFlow, domain=DOMAIN):
errors=errors,
)
@override
@staticmethod
@callback
def async_get_options_flow(
@@ -2,7 +2,7 @@
from datetime import timedelta
import logging
from typing import Any
from typing import Any, override
from aiohttp import ClientSession
from aiohttp.client_exceptions import ClientConnectorError
@@ -69,6 +69,7 @@ class AirNowDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
update_interval=update_interval,
)
@override
async def _async_update_data(self) -> dict[str, Any]:
"""Update data via library."""
data: dict[str, Any] = {}
+3 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from dateutil import parser
@@ -167,11 +167,13 @@ class AirNowSensor(CoordinatorEntity[AirNowDataUpdateCoordinator], SensorEntity)
name=DEFAULT_NAME,
)
@override
@property
def native_value(self) -> StateType:
"""Return the state."""
return self.entity_description.value_fn(self.coordinator.data)
@override
@property
def extra_state_attributes(self) -> dict[str, str] | None:
"""Return the state attributes."""
+2 -1
View File
@@ -2,7 +2,7 @@
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Any
from typing import Any, override
from pyairobotrest.exceptions import (
AirobotConnectionError,
@@ -79,6 +79,7 @@ class AirobotButton(AirobotEntity, ButtonEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.data.status.device_id}_{description.key}"
@override
async def async_press(self) -> None:
"""Handle the button press."""
try:
+10 -1
View File
@@ -1,6 +1,6 @@
"""Climate platform for Airobot thermostat."""
from typing import Any
from typing import Any, override
from pyairobotrest.const import (
MODE_AWAY,
@@ -77,6 +77,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
"""Get settings from coordinator data."""
return self.coordinator.data.settings
@override
@property
def current_temperature(self) -> float | None:
"""Return the current temperature.
@@ -87,11 +88,13 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
return self._status.temp_floor
return self._status.temp_air
@override
@property
def current_humidity(self) -> float | None:
"""Return the current humidity."""
return self._status.hum_air
@override
@property
def target_temperature(self) -> float | None:
"""Return the target temperature."""
@@ -99,6 +102,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
return self._settings.setpoint_temp
return self._settings.setpoint_temp_away
@override
@property
def hvac_mode(self) -> HVACMode:
"""Return current HVAC mode."""
@@ -106,6 +110,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
return HVACMode.HEAT
return HVACMode.OFF
@override
@property
def hvac_action(self) -> HVACAction:
"""Return current HVAC action."""
@@ -113,6 +118,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
return HVACAction.HEATING
return HVACAction.IDLE
@override
@property
def preset_mode(self) -> str | None:
"""Return current preset mode."""
@@ -122,6 +128,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
return PRESET_HOME
return PRESET_AWAY
@override
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temperature = kwargs[ATTR_TEMPERATURE]
@@ -140,6 +147,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
await self.coordinator.async_request_refresh()
@override
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set HVAC mode.
@@ -147,6 +155,7 @@ class AirobotClimate(AirobotEntity, ClimateEntity):
that only supported modes are passed, so this method is a no-op.
"""
@override
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set new preset mode."""
try:
@@ -4,7 +4,7 @@ import asyncio
from collections.abc import Mapping
from dataclasses import dataclass
import logging
from typing import Any
from typing import Any, override
from pyairobotrest import AirobotClient
from pyairobotrest.exceptions import (
@@ -90,6 +90,7 @@ class AirobotConfigFlow(BaseConfigFlow, domain=DOMAIN):
self._discovered_mac: str | None = None
self._discovered_device_id: str | None = None
@override
async def async_step_dhcp(
self, discovery_info: DhcpServiceInfo
) -> ConfigFlowResult:
@@ -154,6 +155,7 @@ class AirobotConfigFlow(BaseConfigFlow, domain=DOMAIN):
errors=errors,
)
@override
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
@@ -3,6 +3,7 @@
import asyncio
from datetime import timedelta
import logging
from typing import override
from pyairobotrest import AirobotClient
from pyairobotrest.exceptions import AirobotAuthError, AirobotConnectionError
@@ -48,6 +49,7 @@ class AirobotDataUpdateCoordinator(DataUpdateCoordinator[AirobotData]):
session=session,
)
@override
async def _async_update_data(self) -> AirobotData:
"""Fetch data from API endpoint."""
try:
@@ -2,6 +2,7 @@
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import override
from pyairobotrest.const import HYSTERESIS_BAND_MAX, HYSTERESIS_BAND_MIN
from pyairobotrest.exceptions import AirobotError
@@ -78,11 +79,13 @@ class AirobotNumber(AirobotEntity, NumberEntity):
self.entity_description = description
self._attr_unique_id = f"{coordinator.data.status.device_id}_{description.key}"
@override
@property
def native_value(self) -> float:
"""Return the current value."""
return self.entity_description.value_fn(self.coordinator)
@override
async def async_set_native_value(self, value: float) -> None:
"""Set the value."""
try:

Some files were not shown because too many files have changed in this diff Show More