Disable mopeka accelerometer sensors by default (#87420)

* Disable mopeka accelerometer sensors by default

These generate a significant amount of noise and are
only useful when placing the sensor. Disable them by
default. This not a breaking change because existing
preferences are preserved.

* adjust tests
pull/87427/head
J. Nick Koston 2023-02-04 14:34:34 -06:00 committed by GitHub
parent 19e27f4f52
commit 3be6d4dcfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -76,10 +76,12 @@ SENSOR_DESCRIPTIONS = {
"accelerometer_x": SensorEntityDescription(
key="accelerometer_x",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
),
"accelerometer_y": SensorEntityDescription(
key="accelerometer_y",
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
),
}

View File

@ -31,7 +31,7 @@ async def test_sensors_bad_signal(hass):
assert len(hass.states.async_all("sensor")) == 0
inject_bluetooth_service_info(hass, PRO_SERVICE_INFO)
await hass.async_block_till_done()
assert len(hass.states.async_all("sensor")) == 6
assert len(hass.states.async_all("sensor")) == 4
temp_sensor = hass.states.get("sensor.pro_plus_eeff_temperature")
temp_sensor_attrs = temp_sensor.attributes
@ -65,7 +65,7 @@ async def test_sensors_good_signal(hass):
assert len(hass.states.async_all("sensor")) == 0
inject_bluetooth_service_info(hass, PRO_GOOD_SIGNAL_SERVICE_INFO)
await hass.async_block_till_done()
assert len(hass.states.async_all("sensor")) == 6
assert len(hass.states.async_all("sensor")) == 4
temp_sensor = hass.states.get("sensor.pro_plus_eeff_temperature")
temp_sensor_attrs = temp_sensor.attributes