Skip to content

Use is/is not for same-enum identity comparisons (3/3)#171597

Closed
justanotherariel wants to merge 1 commit into
home-assistant:devfrom
justanotherariel:automation-enum-is-codemod-3
Closed

Use is/is not for same-enum identity comparisons (3/3)#171597
justanotherariel wants to merge 1 commit into
home-assistant:devfrom
justanotherariel:automation-enum-is-codemod-3

Conversation

@justanotherariel
Copy link
Copy Markdown
Member

Proposed change

Mechanical codemod that replaces == with is (and != with is not)
on every line where both operands statically resolve to the same
enum.Enum subclass. This is a prerequisite to #171551 (the
mypy_plugins.enum_identity_compare plugin that identifies these
sites).

Part 3 of 3 — covers files alphabetically from
homeassistant/components/withings/sensor.py through
tests/util/test_unit_system.py.

# Before:
assert result["type"] == FlowResultType.FORM   # type-checker sees both sides as FlowResultType
# After:
assert result["type"] is FlowResultType.FORM

Scope of this PR: ~1,150 sites across 254 files. (This part is the
test-heavy tail, where many lines have multiple swappable comparisons.)

Scope of the full codemod (all 3 parts): 2,159 sites across 762
files, touching 378 of 1,468 integrations (~26%) plus ~20
core/helper/util files.

What is NOT changed:

  • Flag/IntFlag patterns (features & FEATURE_X == FEATURE_X) —
    bitwise == is idiomatic there.
  • StrEnum/IntEnum sites where the LHS is a raw str/int:
    state.state == HVACMode.HEAT (state-machine string),
    response.status_code == HTTPStatus.OK (HTTP-client integer), etc.
    The plugin correctly skips these and the codemod doesn't touch them.

Validation:

  1. Every changed line corresponds to a ha-enum-identity-compare
    violation reported by the mypy plugin against dev.
  2. The codemod was run iteratively; after the final pass the mypy
    plugin reports zero remaining violations.
  3. Each individual swap was verified by a custom diff checker:
    removed-line == added-line modulo a single ==is (or
    !=is not) substitution, with the swap adjacent to an
    enum-class reference.
  4. All modified files parse (ast.parse).
  5. No new mypy error categories appeared on the touched files
    (informational delta check).

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 diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Part 3 of 3 of a mechanical codemod identified by the
`mypy_plugins.enum_identity_compare` plugin from home-assistant#171551.
Replaces `==` with `is` (and `!=` with `is not`) on every line
where both operands statically resolve to the same `enum.Enum`
subclass.

This part covers files from `homeassistant/components/withings/sensor.py`
through `tests/util/test_unit_system.py` alphabetically — 254 files.

Land order with the other parts and the plugin (home-assistant#171551) does not
matter for correctness, only for CI temporary noise.
Copy link
Copy Markdown
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 is the third part of a repo-wide mechanical codemod replacing ==/!= with is/is not where both operands are intended to be the same enum type, preparing the codebase for the ha-enum-identity-compare mypy plugin.

Changes:

  • Replaced enum equality/inequality comparisons with identity comparisons in core helpers/util code and multiple integrations.
  • Updated a large set of tests to use enum identity comparisons in assertions and control flow.
  • Applied the same replacements in various test utilities/fixtures and integration test suites.

Reviewed changes

Copilot reviewed 254 out of 254 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
homeassistant/util/unit_system.py Switch enum comparisons in unit-system deprecation mapping to identity checks.
homeassistant/util/timeout.py Switch internal _State enum comparison to identity check.
homeassistant/util/ssl.py Switch SSLCipherList enum comparison to identity check.
homeassistant/helpers/trigger.py Switch NumericThresholdType comparison to identity check.
homeassistant/helpers/service.py Switch SupportsResponse comparison to identity check for response metadata.
homeassistant/helpers/selector.py Switch NumericThresholdMode comparison in selector validation to identity check.
homeassistant/helpers/script.py Switch SupportsResponse comparisons in script validation to identity checks.
homeassistant/helpers/intent.py Switch IntentResponseType comparison to identity check in serialization.
homeassistant/helpers/entity_registry.py Switch RegistryEntryDisabler comparisons to identity checks; adjust UNDEFINED sentinel check.
homeassistant/helpers/device_registry.py Switch DeviceEntryDisabler comparison to identity check.
homeassistant/helpers/data_entry_flow.py Switch FlowResultType comparison to identity check for JSON preparation.
homeassistant/data_entry_flow.py Switch FlowResultType comparisons to identity checks in flow handling.
homeassistant/config_entries.py Switch ConfigEntryState, FlowType, and FlowResultType comparisons to identity checks.
homeassistant/components/withings/sensor.py Switch ConfigEntryState comparison to identity check in device listener.
homeassistant/components/zwave_js/triggers/trigger_helpers.py Switch ConfigEntryState comparison to identity check.
homeassistant/components/zwave_js/migrate.py Switch Platform comparison to identity check.
homeassistant/components/zwave_js/light.py Switch ColorMode comparisons to identity checks.
homeassistant/components/zwave_js/helpers.py Switch ConfigEntryState and ConfigurationValueType comparisons to identity checks.
homeassistant/components/zwave_js/discovery.py Switch ConfigurationValueType comparisons to identity checks.
homeassistant/components/zwave_js/discovery_data_template.py Switch MultilevelSensorType comparison to identity check.
homeassistant/components/zwave_js/device_automation_helpers.py Switch ConfigEntryState comparison to identity check.
homeassistant/components/zwave_js/config_flow.py Switch AddonState/ConfigEntryState comparisons to identity checks.
homeassistant/components/zwave_js/climate.py Switch ThermostatSetpointType/HVACMode comparisons to identity checks.
homeassistant/components/zwave_js/api.py Switch InclusionStrategy/NodeStatus comparisons to identity checks.
homeassistant/components/zwave_js/init.py Switch RemoveNodeReason/AddonState comparisons to identity checks.
homeassistant/components/ziggo_mediabox_xl/media_player.py Switch MediaPlayerState comparisons to identity checks.
homeassistant/components/zhong_hong/climate.py Switch HVACMode comparison to identity check.
homeassistant/components/zha/repairs/wrong_silabs_firmware.py Switch ApplicationType/HardwareType comparisons to identity checks.
homeassistant/components/zha/config_flow.py Switch ProbeResult/ZigbeeFlowStrategy comparisons to identity checks.
homeassistant/components/yolink/services.py Switch ConfigEntryState comparison to identity check.
homeassistant/components/yeelight/light.py Switch ColorMode comparisons to identity checks.
homeassistant/components/yeelight/config_flow.py Switch ConfigEntryState comparison to identity check.
homeassistant/components/yamaha_musiccast/media_player.py Switch MediaPlayerState comparisons to identity checks.
homeassistant/components/yalexs_ble/binary_sensor.py Switch DoorStatus comparison to identity check.
homeassistant/components/yale_smart_alarm/lock.py Switch LockState comparisons to identity checks.
homeassistant/components/xiaomi_tv/media_player.py Switch MediaPlayerState comparisons to identity checks.
homeassistant/components/xiaomi_miio/humidifier.py Switch operation-mode enum comparisons to identity checks.
homeassistant/components/xiaomi_ble/config_flow.py Switch EncryptionScheme comparisons to identity checks.
homeassistant/components/xiaomi_ble/init.py Switch EncryptionScheme comparison to identity check.
homeassistant/components/xbox/remote.py Switch PowerState comparison to identity check.
homeassistant/components/wyoming/devices.py Switch VadSensitivity comparison to identity check.
homeassistant/components/wyoming/assist_satellite.py Switch pipeline/timer enum comparisons to identity checks.
tests/util/test_unit_system.py Update unit enum assertions to identity checks.
tests/test_core.py Update core state/job type/release channel assertions to identity checks.
tests/syrupy.py Update snapshot item status comparison to identity check.
tests/helpers/test_trigger_template_entity.py Update device_class enum assertion to identity check.
tests/helpers/test_intent.py Update intent enums assertions to identity checks.
tests/helpers/test_entity_registry.py Update registry hider enum assertion to identity check.
tests/components/zwave_js/test_switch.py Update EntityCategory assertion to identity check.
tests/components/zwave_js/test_sensor.py Update EntityCategory assertion to identity check.
tests/components/zwave_js/test_select.py Update EntityCategory assertion to identity check.
tests/components/zwave_js/test_number.py Update EntityCategory assertion to identity check.
tests/components/zwave_js/test_discovery.py Update EntityCategory assertions to identity checks.
tests/components/zwave_js/test_binary_sensor.py Update EntityCategory assertions to identity checks.
tests/components/zha/test_select.py Update EntityCategory assertion to identity check.
tests/components/zha/test_repairs.py Update HardwareType assertions to identity checks.
tests/components/zha/test_radio_manager.py Update ProbeResult assertions to identity checks.
tests/components/zha/test_helpers.py Update ZCL enum assertions to identity checks.
tests/components/zha/test_config_flow.py Update flow result type comparison to identity check.
tests/components/zha/test_button.py Update EntityCategory assertion to identity check.
tests/components/zeroconf/test_repairs.py Update issue severity enum assertions to identity checks.
tests/components/yandextts/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/yale_smart_alarm/test_config_flow.py Update ConfigEntryState assertion to identity check.
tests/components/wyoming/test_stt.py Update STT result enum assertions to identity checks.
tests/components/wyoming/test_select.py Update VadSensitivity assertions to identity checks.
tests/components/wyoming/test_satellite.py Update intent response type assertions to identity checks.
tests/components/wyoming/test_conversation.py Update intent response/error code assertions to identity checks.
tests/components/wled/test_init.py Update ConfigEntryState assertions to identity checks.
tests/components/websocket_api/test_http.py Update WSMsgType assertions to identity checks.
tests/components/websocket_api/test_auth.py Update WSMsgType assertions to identity checks.
tests/components/weather/test_intent.py Update intent response/match-reason assertions to identity checks.
tests/components/watergate/test_sensor.py Update EntityCategory filtering to identity check.
tests/components/wake_word/test_init.py Update EntityCategory assertion to identity check.
tests/components/voicerss/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/vodafone_station/test_init.py Update ConfigEntryState assertion to identity check.
tests/components/vicare/test_init.py Update issue severity enum assertion to identity check.
tests/components/vera/common.py Update ConfigSource comparisons to identity checks.
tests/components/valve/test_intent.py Update intent response type assertions to identity checks.
tests/components/vacuum/test_init.py Update issue severity enum assertion to identity check.
tests/components/unifiprotect/test_media_source.py Update MediaClass assertions to identity checks.
tests/components/unifi/test_switch.py Update registry disabler enum assertions to identity checks.
tests/components/unifi/test_sensor.py Update registry disabler enum assertions to identity checks.
tests/components/unifi/test_image.py Update registry disabler enum assertion to identity check.
tests/components/unifi/test_button.py Update registry disabler enum assertion to identity check.
tests/components/uhoo/test_config_flow.py Update flow result type assertion to identity check.
tests/components/tts/test_media_source.py Update HTTPStatus assertions to identity checks.
tests/components/tts/test_init.py Update HTTPStatus assertions to identity checks.
tests/components/tplink/test_init.py Update EntityCategory assertion to identity check.
tests/components/tplink/test_config_flow.py Update flow result type comparisons to identity checks.
tests/components/tplink_omada/test_init.py Update config entry state assertions to identity checks.
tests/components/tplink_lte/test_init.py Update issue severity enum assertion to identity check.
tests/components/todo/test_init.py Update todo status enum assertions to identity checks.
tests/components/text/test_init.py Update TextMode assertion to identity check.
tests/components/template/test_vacuum.py Update issue severity enum assertion to identity check.
tests/components/template/test_config.py Update issue severity enum assertion to identity check.
tests/components/template/conftest.py Update ConfigurationStyle comparisons to identity checks.
tests/components/telegram_bot/test_telegram_bot.py Update config entry state assertion to identity check.
tests/components/tami4/test_init.py Update config entry state assertions to identity checks.
tests/components/tailscale/test_sensor.py Update EntityCategory/DeviceEntryType assertions to identity checks.
tests/components/tailscale/test_binary_sensor.py Update EntityCategory/DeviceEntryType assertions to identity checks.
tests/components/synology_dsm/test_media_source.py Update MediaClass assertions to identity checks.
tests/components/switchbot_cloud/test_init.py Update config entry state assertions to identity checks.
tests/components/switch_as_x/test_init.py Update registry hider enum assertion to identity check.
tests/components/switch_as_x/test_config_flow.py Update registry hider enum assertion to identity check.
tests/components/surepetcare/test_sensor.py Update registry disabler enum assertion to identity check.
tests/components/stt/test_init.py Update audio enum assertions to identity checks.
tests/components/stream/test_worker.py Update error code enum assertion to identity check.
tests/components/steam_online/test_init.py Update DeviceEntryType assertion to identity check.
tests/components/sonos/test_media_browser.py Update MediaClass assertion to identity check.
tests/components/snooz/init.py Update connection status enum comparison to identity check.
tests/components/smartthings/init.py Update Platform comparison to identity check.
tests/components/sma/test_init.py Update config entry state assertions to identity checks.
tests/components/shopping_list/test_intent.py Update intent response type assertions to identity checks.
tests/components/shopping_list/test_init.py Update intent response type assertion to identity check.
tests/components/shell_command/test_init.py Update issue severity enum assertion to identity check.
tests/components/sftp_storage/test_backup.py Update ConfigEntryState assertion to identity check.
tests/components/satel_integra/test_init.py Update config entry state assertion to identity check.
tests/components/samsungtv/test_init.py Update ConfigEntryState assertion to identity check.
tests/components/roku/test_sensor.py Update EntityCategory assertions to identity checks.
tests/components/roku/test_binary_sensor.py Update EntityCategory assertions to identity checks.
tests/components/roborock/test_vacuum.py Update issue severity enum assertion to identity check.
tests/components/roborock/conftest.py Update category enum comparison to identity check.
tests/components/rituals_perfume_genie/test_sensor.py Update EntityCategory assertions to identity checks.
tests/components/rituals_perfume_genie/test_select.py Update EntityCategory assertion to identity check.
tests/components/rituals_perfume_genie/test_binary_sensor.py Update EntityCategory assertion to identity check.
tests/components/reolink/test_init.py Update config entry state assertion to identity check.
tests/components/recorder/db_schema_51.py Update dialect enum comparison to identity check.
tests/components/recorder/db_schema_50.py Update dialect enum comparison to identity check.
tests/components/recorder/db_schema_48.py Update dialect enum comparison to identity check.
tests/components/recorder/db_schema_43.py Update dialect enum comparison to identity check.
tests/components/recorder/common.py Update event origin enum assertion to identity check.
tests/components/radio_browser/test_media_source.py Update ConfigEntryState assertions to identity checks.
tests/components/radio_browser/conftest.py Update ConfigEntryState assertion to identity check.
tests/components/proxmoxve/test_init.py Update config entry state assertions to identity checks.
tests/components/portainer/test_init.py Update config entry state assertions to identity checks.
tests/components/picotts/test_tts.py Update HTTPStatus assertion to identity check.
tests/components/paperless_ngx/test_init.py Update config entry state assertion to identity check.
tests/components/overseerr/test_init.py Update config entry state assertion to identity check.
tests/components/ourgroceries/test_init.py Update config entry state assertion to identity check.
tests/components/otbr/test_config_flow.py Update key format enum comparisons to identity checks.
tests/components/otbr/conftest.py Update HTTPStatus selection to identity check.
tests/components/opower/test_coordinator.py Update issue severity enum assertion to identity check.
tests/components/opentherm_gw/test_switch.py Update registry disabler enum assertion to identity check.
tests/components/openai_conversation/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/openai_conversation/test_conversation.py Update intent response type assertions to identity checks.
tests/components/open_router/test_conversation.py Update intent response type assertions to identity checks.
tests/components/ntfy/test_config_flow.py Update flow type enum assertion to identity check.
tests/components/nextcloud/test_init.py Update config entry state assertion to identity check.
tests/components/mqtt/common.py Update EntityCategory assertion to identity check.
tests/components/mobile_app/test_webhook.py Update registry disabler enum assertion to identity check.
tests/components/mobile_app/test_sensor.py Update registry disabler enum assertion to identity check.
tests/components/microsoft/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/maxcube/test_maxcube_binary_sensor.py Update EntityCategory assertions to identity checks.
tests/components/matter/test_sensor.py Update EntityCategory assertions to identity checks.
tests/components/marytts/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/lovelace/test_dashboard.py Update issue severity enum assertion to identity check.
tests/components/lovelace/test_cast.py Update MediaClass assertion to identity check.
tests/components/lifx/test_binary_sensor.py Update EntityCategory assertion to identity check.
tests/components/lcn/test_config_flow.py Update flow result type assertions to identity checks.
tests/components/lawn_mower/test_intent.py Update intent response type assertions to identity checks.
tests/components/lametric/test_button.py Update EntityCategory assertions to identity checks.
tests/components/lamarzocco/conftest.py Update model enum comparisons to identity checks.
tests/components/lamarzocco/init.py Update model enum comparison to identity check.
tests/components/kitchen_sink/test_init.py Update issue severity enum assertion to identity check.
tests/components/jewish_calendar/test_calendar.py Update daily event type filtering to identity check.
tests/components/intent/test_init.py Update intent response type assertions to identity checks.
tests/components/influxdb/test_init.py Update ConfigEntryState assertions to identity checks.
tests/components/imap/test_config_flow.py Update flow result type assertion to identity check.
tests/components/humidifier/test_intent.py Update intent response/match reason assertions to identity checks.
tests/components/hue/test_sensor_v1.py Update EntityCategory assertion to identity check.
tests/components/html5/test_config_flow.py Update flow result type assertion to identity check.
tests/components/homeassistant/test_init.py Update issue severity enum assertions to identity checks.
tests/components/homeassistant_sky_connect/test_util.py Update hardware variant assertions to identity checks.
tests/components/homeassistant_sky_connect/test_const.py Update hardware variant assertions to identity checks.
tests/components/homeassistant_hardware/test_switch.py Update EntityCategory assertion to identity check.
tests/components/homeassistant_hardware/test_config_flow.py Update flow result type comparison to identity check.
tests/components/home_connect/test_select.py Update SettingKey comparison to identity check.
tests/components/home_connect/test_init.py Update config entry state assertion to identity check.
tests/components/home_connect/test_button.py Update CommandKey comparison to identity check.
tests/components/hikvision/test_binary_sensor.py Update issue severity enum assertions to identity checks.
tests/components/hassio/test_issues.py Update unsupported reason filtering to identity check.
tests/components/hassio/test_init.py Update issue severity enum assertions to identity checks.
tests/components/gree/test_climate.py Update temperature unit enum comparisons to identity checks.
tests/components/google/test_calendar.py Update registry disabler enum assertion to identity check.
tests/components/google_translate/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/google_generative_ai_conversation/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/google_generative_ai_conversation/test_conversation.py Update intent response type assertions to identity checks.
tests/components/google_assistant/test_trait.py Update sensor device class comparisons to identity checks.
tests/components/go2rtc/test_init.py Update config entry state assertions and issue severity assertions to identity checks.
tests/components/fully_kiosk/test_sensor.py Update EntityCategory assertions to identity checks.
tests/components/fully_kiosk/test_binary_sensor.py Update EntityCategory assertions to identity checks.
tests/components/fish_audio/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/firefly_iii/test_init.py Update config entry state assertion to identity check.
tests/components/fan/test_intent.py Update intent response type assertion to identity check.
tests/components/evohome/conftest.py Update HTTP method enum comparison to identity check.
tests/components/esphome/test_manager.py Update log level/support response assertions to identity checks.
tests/components/esphome/test_enum_mapper.py Update mapping enum assertions to identity checks.
tests/components/enphase_envoy/test_sensor.py Update registry disabler filtering to identity check.
tests/components/energy/test_sensor.py Update registry hider enum assertion to identity check.
tests/components/emulated_hue/test_hue_api.py Update HTTPStatus comparison to identity check.
tests/components/elevenlabs/test_tts.py Update HTTPStatus assertions to identity checks.
tests/components/elevenlabs/test_stt.py Update STT result enum assertions to identity checks.
tests/components/ecovacs/test_config_flow.py Update SSL verify mode comparison to identity check.
tests/components/duco/test_sensor.py Update registry disabler assertions and node type comparison to identity checks.
tests/components/device_tracker/test_config_entry.py Update registry disabler assertions to identity checks.
tests/components/cover/test_intent.py Update intent response type assertions to identity checks.
tests/components/cookidoo/test_init.py Update config entry state assertion to identity check.
tests/components/conversation/test_chat_log.py Update chat log event type assertions to identity checks.
tests/components/config/test_entity_registry.py Update registry disabler assertion to identity check.
tests/components/config/test_config_entries.py Update flow result type assertions to identity checks.
tests/components/comelit/test_init.py Update ConfigEntryState assertion to identity check.
tests/components/cloud/test_tts.py Update issue severity enum assertions to identity checks.
tests/components/climate/test_init.py Update HVACMode assertion to identity check.
tests/components/climate/test_condition.py Update HVAC mode filtering to identity check.
tests/components/casper_glow/test_init.py Update ConfigEntryState assertion to identity check.
tests/components/camera/test_prefs.py Update orientation enum assertions to identity checks.
tests/components/bsblan/test_climate.py Update HVAC action assertions to identity checks.
tests/components/bring/test_init.py Update config entry state assertion to identity check.
tests/components/bluetooth/test_manager.py Update issue severity enum assertions to identity checks.
tests/components/bayesian/test_config_flow.py Update flow result type assertions to identity checks.
tests/components/backup/test_manager.py Update backup manager state assertion to identity check.
tests/components/azure_data_explorer/test_config_flow.py Update flow result type assertions to identity checks.
tests/components/axis/test_hub.py Update config entry state assertions to identity checks.
tests/components/assist_pipeline/test_pipeline.py Update pipeline event type comparisons to identity checks.
tests/components/assist_pipeline/test_init.py Update pipeline event type assertions to identity checks.
tests/components/anthropic/test_coordinator.py Update intent response type assertions to identity checks.
tests/components/anthropic/test_conversation.py Update device entry type and intent response assertions to identity checks.
tests/components/alexa_devices/test_init.py Update ConfigEntryState assertion to identity check.
tests/components/airos/test_init.py Update config entry state assertion to identity check.
tests/components/airos/test_config_flow.py Update flow result type assertions to identity checks.
tests/common.py Update issue severity enum assertion to identity check.
tests/auth/providers/test_homeassistant.py Update flow result type assertions to identity checks.
tests/auth/providers/test_command_line.py Update flow result type assertions to identity checks.
tests/auth/mfa_modules/test_totp.py Update flow result type assertions to identity checks.
tests/auth/mfa_modules/test_insecure_example.py Update flow result type assertions to identity checks.

Comment on lines 1625 to 1627
mode = self.config["mode"]
if mode != NumericThresholdMode.CHANGED:
if mode is not NumericThresholdMode.CHANGED:
validators.append(_validate_numeric_threshold_not_any)
Comment on lines 739 to 744
return False

if self._threshold_type == NumericThresholdType.ANY:
if self._threshold_type is NumericThresholdType.ANY:
# If the threshold type is "any" we always trigger on valid state
# changes
return True
Comment on lines 661 to 666
if (
response := hass.services.supports_response(domain, service)
) != SupportsResponse.NONE:
) is not SupportsResponse.NONE:
description["response"] = {
"optional": response == SupportsResponse.OPTIONAL,
}
@zxdavb
Copy link
Copy Markdown
Member

zxdavb commented May 20, 2026

OK for evohome, thanks.

@justanotherariel
Copy link
Copy Markdown
Member Author

No longer needed - moved to #171591

@justanotherariel justanotherariel deleted the automation-enum-is-codemod-3 branch May 21, 2026 07:52
@github-actions github-actions Bot locked and limited conversation to collaborators May 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants