Skip to content

Conversation

@kclif9
Copy link
Contributor

@kclif9 kclif9 commented Dec 7, 2025

Proposed change

Adds the sensor entity type to the Actron Air integration. The majority of the A/C sensors are marked as disabled diagnostic sensors and can be enabled by the user if they wish. The only enabled out of the box one is clean filter.

Each peripheral (A/C temperature sensor) is zone assignable, but may have multiple sensors per zone. These are represented as individual objects.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Dec 7, 2025

Hey there @JagadishDhanamjayam, mind taking a look at this pull request as it has been labeled with an integration (actron_air) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of actron_air can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign actron_air Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds sensor and switch platforms to the Actron Air integration, expanding functionality beyond the existing climate platform. The implementation includes comprehensive diagnostic sensors for the AC system and primary sensors for peripheral devices (battery, temperature, humidity), along with configuration switches for various AC operational modes.

Key Changes

  • Added 8 AC system sensors (mostly diagnostic, disabled by default) with one primary sensor (clean filter) enabled by default
  • Added 3 peripheral sensors per device (battery, humidity, temperature) that represent zone controller measurements
  • Added 4 configuration switches (away mode, continuous fan, quiet mode, turbo mode) with conditional turbo switch based on system support
  • Updated quality scale status to reflect new Gold-level features (entity categories, device classes, translations)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
homeassistant/components/actron_air/sensor.py New sensor platform implementation with AC system and peripheral sensors. Has critical bug with entity registration loop placement and issues with entity categorization for peripheral sensors
homeassistant/components/actron_air/switch.py New switch platform for AC configuration modes (away, continuous fan, quiet, turbo)
tests/components/actron_air/test_sensor.py Comprehensive unit tests for sensor platform covering setup and entity properties
tests/components/actron_air/test_switch.py Unit tests for switch platform including conditional entity creation and API call verification
homeassistant/components/actron_air/strings.json Added entity translations for sensors and switches. Contains unused translation entry
homeassistant/components/actron_air/icons.json New file with state-based icon definitions for switches
homeassistant/components/actron_air/quality_scale.yaml Updated to mark entity-related Gold features as complete
homeassistant/components/actron_air/__init__.py Updated PLATFORM list to include new sensor and switch platforms

@home-assistant
Copy link

home-assistant bot commented Dec 7, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft December 7, 2025 11:24
@kclif9
Copy link
Contributor Author

kclif9 commented Dec 16, 2025

@home-assistant add-label draft

@kclif9
Copy link
Contributor Author

kclif9 commented Dec 16, 2025

Waiting until #158087 is merged to dev before updating this one as there are likely to be merge conflicts

@kclif9 kclif9 marked this pull request as ready for review December 20, 2025 06:23
…on-flow as exempt, and set entity-translations and exception-translations to done
from .coordinator import ActronAirSystemCoordinator


class ActronAirAcSensor(CoordinatorEntity[ActronAirSystemCoordinator]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this only a base class for the sensor and why don't we create a base for all other entity types?

Comment on lines +55 to +57
if hasattr(peripheral, "zones") and len(peripheral.zones) == 1:
zone = peripheral.zones[0]
if hasattr(zone, "title") and zone.title:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would we use hasattr here?

Comment on lines +29 to +31
action-exceptions:
status: exempt
comment: This integration does not have custom service actions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you do have climate and switch actions, which are also considered actions

Comment on lines +31 to +34
ActronAirSensorEntityDescription(
key="clean_filter",
translation_key="clean_filter",
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can the state be?

Comment on lines +35 to +39
ActronAirSensorEntityDescription(
key="defrost_mode",
translation_key="defrost_mode",
entity_registry_enabled_default=False,
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can the state be?

Comment on lines +56 to +60
ActronAirSensorEntityDescription(
key="compressor_mode",
translation_key="compressor_mode",
entity_registry_enabled_default=False,
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What can the state be?

ActronAirSensorEntityDescription(
key="compressor_speed",
translation_key="compressor_speed",
native_unit_of_measurement="RPM",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we have a constant for this unit of measurement

Comment on lines +155 to +159
return getattr(
self.coordinator.data,
self.entity_description.attribute_name or self.entity_description.key,
None,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using getattr, can we extend the SensorEntityDescription and add a value_fn to fetch the data? That way it's also type safe and we don't have to use an or here

Comment on lines +34 to +58
async def _create_coordinator(
hass: HomeAssistant, peripherals: list[MockPeripheral]
) -> ActronAirSystemCoordinator:
"""Create a coordinator instance backed by mocked API data."""
config_entry = MockConfigEntry(domain=DOMAIN, data={})
api = MagicMock()
api.update_status = AsyncMock()
api.state_manager = MagicMock()

ac_system = SimpleNamespace(
system_name="NEO_23C04269",
master_wc_model="NTW-100",
master_wc_firmware_version="1.0.0",
)

status = SimpleNamespace(
ac_system=ac_system,
peripherals=peripherals,
clean_filter=False,
defrost_mode=False,
compressor_chasing_temperature=24.0,
compressor_live_temperature=23.5,
compressor_mode="cooling",
compressor_speed=50,
compressor_power=1500,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't create our own coordinator in the tests. Instead, patch the library to return what we expect and then make HA setup the integration.

I think we should add such peripherals to the mock we have in conftest.py

@home-assistant home-assistant bot marked this pull request as draft December 20, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants