Get Ohme to gold quality (#140617)

* Add reconfigure step, diagnostics and default disabled entities to Ohme

* Formatting

* Update tests

* Bugfixes and add tests for diagnostics and reconfigure

* Remove diagnostics changes

* Remove reconfigure changes

* Pull upstream strings.json
This commit is contained in:
Dan Raper 2025-03-28 18:41:00 +00:00 committed by GitHub
parent 7ae397a211
commit 82b463b22f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 10 deletions

View File

@ -48,17 +48,20 @@ rules:
status: exempt status: exempt
comment: | comment: |
All supported devices are cloud connected over mobile data. Discovery is not possible. All supported devices are cloud connected over mobile data. Discovery is not possible.
docs-data-update: todo docs-data-update: done
docs-examples: todo docs-examples: done
docs-known-limitations: todo docs-known-limitations: done
docs-supported-devices: done docs-supported-devices: done
docs-supported-functions: todo docs-supported-functions: done
docs-troubleshooting: todo docs-troubleshooting: done
docs-use-cases: todo docs-use-cases: done
dynamic-devices: todo dynamic-devices:
entity-category: todo status: exempt
comment: |
Not supported by the API. Accounts and devices have a one-to-one relationship.
entity-category: done
entity-device-class: done entity-device-class: done
entity-disabled-by-default: todo entity-disabled-by-default: done
entity-translations: done entity-translations: done
exception-translations: done exception-translations: done
icon-translations: done icon-translations: done
@ -67,7 +70,10 @@ rules:
status: exempt status: exempt
comment: | comment: |
This integration currently has no repairs. This integration currently has no repairs.
stale-devices: todo stale-devices:
status: exempt
comment: |
Not supported by the API. Accounts and devices have a one-to-one relationship.
# Platinum # Platinum
async-dependency: todo async-dependency: todo
inject-websession: todo inject-websession: todo

View File

@ -99,6 +99,7 @@ SENSOR_ADVANCED_SETTINGS = [
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE, native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
value_fn=lambda client: client.power.ct_amps, value_fn=lambda client: client.power.ct_amps,
is_supported_fn=lambda client: client.ct_connected, is_supported_fn=lambda client: client.ct_connected,
entity_registry_enabled_default=False,
), ),
] ]

View File

@ -5,6 +5,7 @@ from unittest.mock import MagicMock, patch
from freezegun.api import FrozenDateTimeFactory from freezegun.api import FrozenDateTimeFactory
from ohme import ApiException from ohme import ApiException
import pytest
from syrupy import SnapshotAssertion from syrupy import SnapshotAssertion
from homeassistant.const import STATE_UNAVAILABLE, Platform from homeassistant.const import STATE_UNAVAILABLE, Platform
@ -16,6 +17,7 @@ from . import setup_integration
from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform from tests.common import MockConfigEntry, async_fire_time_changed, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_sensors( async def test_sensors(
hass: HomeAssistant, hass: HomeAssistant,
entity_registry: er.EntityRegistry, entity_registry: er.EntityRegistry,