mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Add Aranet Radon Plus support (#124197)
added aranet radon plus support
This commit is contained in:
parent
9399a54c7a
commit
4ef55e5088
@ -6,6 +6,9 @@
|
|||||||
},
|
},
|
||||||
"radiation_rate": {
|
"radiation_rate": {
|
||||||
"default": "mdi:radioactive"
|
"default": "mdi:radioactive"
|
||||||
|
},
|
||||||
|
"radon_concentration": {
|
||||||
|
"default": "mdi:radioactive"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,5 +19,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/aranet",
|
"documentation": "https://www.home-assistant.io/integrations/aranet",
|
||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"requirements": ["aranet4==2.3.4"]
|
"requirements": ["aranet4==2.4.0"]
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,13 @@ SENSOR_DESCRIPTIONS = {
|
|||||||
suggested_display_precision=4,
|
suggested_display_precision=4,
|
||||||
scale=0.000001,
|
scale=0.000001,
|
||||||
),
|
),
|
||||||
|
"radon_concentration": AranetSensorEntityDescription(
|
||||||
|
key="radon_concentration",
|
||||||
|
translation_key="radon_concentration",
|
||||||
|
name="Radon Concentration",
|
||||||
|
native_unit_of_measurement="Bq/m³",
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
"battery": AranetSensorEntityDescription(
|
"battery": AranetSensorEntityDescription(
|
||||||
key="battery",
|
key="battery",
|
||||||
name="Battery",
|
name="Battery",
|
||||||
|
@ -470,7 +470,7 @@ apsystems-ez1==2.2.1
|
|||||||
aqualogic==2.6
|
aqualogic==2.6
|
||||||
|
|
||||||
# homeassistant.components.aranet
|
# homeassistant.components.aranet
|
||||||
aranet4==2.3.4
|
aranet4==2.4.0
|
||||||
|
|
||||||
# homeassistant.components.arcam_fmj
|
# homeassistant.components.arcam_fmj
|
||||||
arcam-fmj==1.5.2
|
arcam-fmj==1.5.2
|
||||||
|
@ -440,7 +440,7 @@ aprslib==0.7.2
|
|||||||
apsystems-ez1==2.2.1
|
apsystems-ez1==2.2.1
|
||||||
|
|
||||||
# homeassistant.components.aranet
|
# homeassistant.components.aranet
|
||||||
aranet4==2.3.4
|
aranet4==2.4.0
|
||||||
|
|
||||||
# homeassistant.components.arcam_fmj
|
# homeassistant.components.arcam_fmj
|
||||||
arcam-fmj==1.5.2
|
arcam-fmj==1.5.2
|
||||||
|
@ -82,3 +82,11 @@ VALID_ARANET_RADIATION_DATA_SERVICE_INFO = fake_service_info(
|
|||||||
1794: b"\x02!&\x04\x01\x00`-\x00\x00\x08\x98\x05\x00n\x00\x00d\x00,\x01\xfd\x00\xc7"
|
1794: b"\x02!&\x04\x01\x00`-\x00\x00\x08\x98\x05\x00n\x00\x00d\x00,\x01\xfd\x00\xc7"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
VALID_ARANET_RADON_DATA_SERVICE_INFO = fake_service_info(
|
||||||
|
"AranetRn+ 12345",
|
||||||
|
"0000fce0-0000-1000-8000-00805f9b34fb",
|
||||||
|
{
|
||||||
|
1794: b"\x03!\x04\x06\x01\x00\x00\x00\x07\x00\xfe\x01\xc9'\xce\x01\x00d\x01X\x02\xf6\x01\x08"
|
||||||
|
},
|
||||||
|
)
|
||||||
|
@ -11,6 +11,7 @@ from . import (
|
|||||||
DISABLED_INTEGRATIONS_SERVICE_INFO,
|
DISABLED_INTEGRATIONS_SERVICE_INFO,
|
||||||
VALID_ARANET2_DATA_SERVICE_INFO,
|
VALID_ARANET2_DATA_SERVICE_INFO,
|
||||||
VALID_ARANET_RADIATION_DATA_SERVICE_INFO,
|
VALID_ARANET_RADIATION_DATA_SERVICE_INFO,
|
||||||
|
VALID_ARANET_RADON_DATA_SERVICE_INFO,
|
||||||
VALID_DATA_SERVICE_INFO,
|
VALID_DATA_SERVICE_INFO,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -188,6 +189,71 @@ async def test_sensors_aranet4(hass: HomeAssistant) -> None:
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||||
|
async def test_sensors_aranetrn(hass: HomeAssistant) -> None:
|
||||||
|
"""Test setting up creates the sensors for Aranet Radon device."""
|
||||||
|
entry = MockConfigEntry(
|
||||||
|
domain=DOMAIN,
|
||||||
|
unique_id="aa:bb:cc:dd:ee:ff",
|
||||||
|
)
|
||||||
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
|
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
assert len(hass.states.async_all("sensor")) == 0
|
||||||
|
inject_bluetooth_service_info(hass, VALID_ARANET_RADON_DATA_SERVICE_INFO)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
assert len(hass.states.async_all("sensor")) == 6
|
||||||
|
|
||||||
|
batt_sensor = hass.states.get("sensor.aranetrn_12345_battery")
|
||||||
|
batt_sensor_attrs = batt_sensor.attributes
|
||||||
|
assert batt_sensor.state == "100"
|
||||||
|
assert batt_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Battery"
|
||||||
|
assert batt_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||||
|
assert batt_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
co2_sensor = hass.states.get("sensor.aranetrn_12345_radon_concentration")
|
||||||
|
co2_sensor_attrs = co2_sensor.attributes
|
||||||
|
assert co2_sensor.state == "7"
|
||||||
|
assert co2_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Radon Concentration"
|
||||||
|
assert co2_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "Bq/m³"
|
||||||
|
assert co2_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
humid_sensor = hass.states.get("sensor.aranetrn_12345_humidity")
|
||||||
|
humid_sensor_attrs = humid_sensor.attributes
|
||||||
|
assert humid_sensor.state == "46.2"
|
||||||
|
assert humid_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Humidity"
|
||||||
|
assert humid_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "%"
|
||||||
|
assert humid_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
temp_sensor = hass.states.get("sensor.aranetrn_12345_temperature")
|
||||||
|
temp_sensor_attrs = temp_sensor.attributes
|
||||||
|
assert temp_sensor.state == "25.5"
|
||||||
|
assert temp_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Temperature"
|
||||||
|
assert temp_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "°C"
|
||||||
|
assert temp_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
press_sensor = hass.states.get("sensor.aranetrn_12345_pressure")
|
||||||
|
press_sensor_attrs = press_sensor.attributes
|
||||||
|
assert press_sensor.state == "1018.5"
|
||||||
|
assert press_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Pressure"
|
||||||
|
assert press_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "hPa"
|
||||||
|
assert press_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
interval_sensor = hass.states.get("sensor.aranetrn_12345_update_interval")
|
||||||
|
interval_sensor_attrs = interval_sensor.attributes
|
||||||
|
assert interval_sensor.state == "600"
|
||||||
|
assert (
|
||||||
|
interval_sensor_attrs[ATTR_FRIENDLY_NAME] == "AranetRn+ 12345 Update Interval"
|
||||||
|
)
|
||||||
|
assert interval_sensor_attrs[ATTR_UNIT_OF_MEASUREMENT] == "s"
|
||||||
|
assert interval_sensor_attrs[ATTR_STATE_CLASS] == "measurement"
|
||||||
|
|
||||||
|
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||||
async def test_smart_home_integration_disabled(hass: HomeAssistant) -> None:
|
async def test_smart_home_integration_disabled(hass: HomeAssistant) -> None:
|
||||||
"""Test disabling smart home integration marks entities as unavailable."""
|
"""Test disabling smart home integration marks entities as unavailable."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user