-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add STIPS IR Remote integration (climate platform) for stips.tech #168264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hanyNaji
wants to merge
60
commits into
home-assistant:dev
Choose a base branch
from
hanyNaji:stips-ir-remote-climate
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
785c4c4
Add STIPS IR Remote integration (climate platform)
hanyNaji 6db750b
Fix STIPS IR Remote core CI issues
hanyNaji 454b7b9
Refactor stips_iru1 auth, availability, and config flow
hanyNaji 9a5cf5e
Fix STIPS core PR CI regressions
hanyNaji bf6061b
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji cd9eecc
Update homeassistant/components/stips_iru1/config_flow.py
hanyNaji b2d0953
Update homeassistant/components/stips_iru1/const.py
hanyNaji b108696
Update homeassistant/components/stips_iru1/climate.py
hanyNaji ab8e472
Update tests/components/stips_iru1/test_init.py
hanyNaji a071c19
Update tests/components/stips_iru1/test_config_flow.py
hanyNaji 1d35997
Fix STIPS manifest quality scale and config flow typing
hanyNaji e30d6df
Update homeassistant/components/stips_iru1/api.py
hanyNaji 2b4710d
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji 7bfad75
Add STIPS quality scale metadata
hanyNaji 910fd2f
Fix stips iru1 hassfest and requirements check failures
hanyNaji f82ae4b
Add runtime_data and setup validation for stips iru1
hanyNaji d5ac509
Apply prek formatting fixes for stips iru1 files
hanyNaji 5712dcd
Use climate component root import in stips helper test
hanyNaji 3576263
Stabilize stips exception handling for ruff format
hanyNaji f46bea2
Update homeassistant/components/stips_iru1/strings.json
hanyNaji 015e0e5
Update homeassistant/components/stips_iru1/climate.py
hanyNaji 2bb670f
Address stips review feedback on safety typing and tests
hanyNaji 80cd6ea
Fix stips iot_class manifest value
hanyNaji 238358a
Add MockConfigEntry type annotations in stips tests
hanyNaji 030659d
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji 01baf90
Initialize stips climate control host cache attrs
hanyNaji 1cfcf40
Sync stips generated integrations iot class
hanyNaji 8e7e951
Fix stips_iru1 test failures: add translation descriptions and valida…
hanyNaji 29a06a9
Add comprehensive test coverage for stips_iru1 climate entities
hanyNaji 1e9cb22
Add HTTP failure and edge case tests for climate entities
hanyNaji 1075b94
Fix stips test lint/syntax regressions from coverage patch
hanyNaji 7cc5eca
Refactor test formatting and context managers
hanyNaji bbfc61c
Combine nested withs into single context
hanyNaji 471088f
Use Platform enum in stips_iru1 test
hanyNaji fb696e1
Update homeassistant/components/stips_iru1/manifest.json
hanyNaji 8ef6f04
Update homeassistant/components/stips_iru1/climate.py
hanyNaji 7bae788
Update homeassistant/components/stips_iru1/climate.py
hanyNaji f5ef2a5
Update homeassistant/components/stips_iru1/quality_scale.yaml
hanyNaji f603123
Update homeassistant/components/stips_iru1/climate.py
hanyNaji 2ac6cb1
Update homeassistant/components/stips_iru1/climate.py
hanyNaji 8fc2fbd
Update homeassistant/components/stips_iru1/climate.py
hanyNaji 9bd7217
Fix mypy error by explicitly constructing DeviceInfo in StipsIruClima…
hanyNaji 7ef5fac
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji d0b905b
Fix PR 168264: Replace corrupted climate.py with verified correct ver…
hanyNaji bcad7db
Fix mypy errors and typing issues in climate.py (PR tests)
hanyNaji 4dfeb1a
Fix remaining STIPS review issues
hanyNaji cf97e21
Apply prek formatting for STIPS climate
hanyNaji 04d0b70
Fix final ruff whitespace issue in STIPS climate
hanyNaji c219e62
Fix pylint imports in STIPS climate
hanyNaji 25a58e9
Apply ruff import cleanup for STIPS climate
hanyNaji 1db3ea6
Fix remaining STIPS test failures
hanyNaji f96d40f
Add STIPS coverage tests
hanyNaji ab8165e
Fix STIPS coverage test regressions
hanyNaji 485d733
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji aa99044
Cover remaining STIPS error handling paths
hanyNaji 66219b6
Expand STIPS climate coverage paths
hanyNaji eeab1a7
Stabilize Google all-day calendar sync tests
hanyNaji 0308d2d
Cover remaining STIPS patch coverage paths
hanyNaji 2cc2a1b
Merge branch 'dev' into stips-ir-remote-climate
hanyNaji bdb22f1
Handle template timeout thread races
hanyNaji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| """STIPS IRU1 Home Assistant integration.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from typing import Any | ||
|
|
||
| from homeassistant.config_entries import ConfigEntry | ||
| from homeassistant.core import HomeAssistant | ||
| from homeassistant.exceptions import ConfigEntryError | ||
| from homeassistant.helpers import device_registry as dr | ||
|
|
||
| from .catalog import normalize_device_mac | ||
| from .const import DOMAIN, PLATFORMS | ||
|
|
||
|
|
||
| @dataclass(slots=True) | ||
| class StipsIru1RuntimeData: | ||
| """Runtime data for the STIPS IRU1 integration.""" | ||
|
|
||
| devices: list[dict[str, Any]] | ||
|
|
||
|
|
||
| type StipsIru1ConfigEntry = ConfigEntry[StipsIru1RuntimeData] | ||
|
|
||
|
|
||
| def _register_catalog_devices(hass: HomeAssistant, entry: StipsIru1ConfigEntry) -> None: | ||
| """Ensure every IR unit in the catalog has a device registry entry. | ||
|
|
||
| Units with only protocol-AC remotes create no signal-based remote entities; without this, | ||
| Home Assistant would not list them under the integration. | ||
| """ | ||
| reg = dr.async_get(hass) | ||
| for device in entry.data.get("devices", []): | ||
| uid = device.get("uniqueName") | ||
| if not uid: | ||
| continue | ||
| name = device.get("name") or uid | ||
| sw = device.get("buildVersion") | ||
| kwargs: dict[str, Any] = { | ||
| "config_entry_id": entry.entry_id, | ||
| "identifiers": {(DOMAIN, str(uid))}, | ||
| "name": name, | ||
| "manufacturer": "STIPS", | ||
| "model": "IRU1", | ||
| "sw_version": str(sw) if sw is not None else None, | ||
| } | ||
| mac = normalize_device_mac(device) | ||
| if mac: | ||
| kwargs["connections"] = {(dr.CONNECTION_NETWORK_MAC, mac)} | ||
| area_name = device.get("areaName") | ||
| if area_name: | ||
| kwargs["suggested_area"] = str(area_name) | ||
| reg.async_get_or_create(**kwargs) | ||
|
|
||
|
|
||
| async def async_setup_entry(hass: HomeAssistant, entry: StipsIru1ConfigEntry) -> bool: | ||
| """Set up STIPS IRU1 from a config entry.""" | ||
| devices = entry.data.get("devices", []) | ||
| if not isinstance(devices, list): | ||
| raise ConfigEntryError("Invalid devices data in config entry") | ||
|
|
||
| entry.runtime_data = StipsIru1RuntimeData(devices=devices) | ||
|
|
||
| _register_catalog_devices(hass, entry) | ||
| await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) | ||
| return True | ||
|
|
||
|
|
||
| async def async_unload_entry(hass: HomeAssistant, entry: StipsIru1ConfigEntry) -> bool: | ||
| """Unload a config entry.""" | ||
| return await hass.config_entries.async_unload_platforms(entry, PLATFORMS) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Compatibility wrapper for STIPS API client. | ||
|
|
||
| Core-bound integration code should consume communication logic from the standalone | ||
| `stips_api_bridge` package for dependency transparency. | ||
| """ | ||
|
|
||
| from stips_api_bridge.api import ( | ||
| StipsApiAuthError, | ||
| StipsApiClient, | ||
| StipsApiError, | ||
| StipsApiPermissionError, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "StipsApiAuthError", | ||
| "StipsApiClient", | ||
| "StipsApiError", | ||
| "StipsApiPermissionError", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| """Compatibility wrapper for STIPS catalog helpers.""" | ||
|
|
||
| from stips_api_bridge.catalog import ( | ||
| async_enrich_remote_model, | ||
| async_fetch_catalog_devices, | ||
| iter_device_host_candidates, | ||
| iter_model_read_type_keys, | ||
| iter_model_read_type_keys_union, | ||
| model_has_ir_signals, | ||
| model_read_name_or_id, | ||
| normalize_device_ip, | ||
| normalize_device_mac, | ||
| normalize_device_online, | ||
| ) | ||
|
|
||
| __all__ = [ | ||
| "async_enrich_remote_model", | ||
| "async_fetch_catalog_devices", | ||
| "iter_device_host_candidates", | ||
| "iter_model_read_type_keys", | ||
| "iter_model_read_type_keys_union", | ||
| "model_has_ir_signals", | ||
| "model_read_name_or_id", | ||
| "normalize_device_ip", | ||
| "normalize_device_mac", | ||
| "normalize_device_online", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.