Skip to content

Commit fb5c4a1

Browse files
authored
Improve Ruuvi Air support (#155678)
1 parent 60b8392 commit fb5c4a1

File tree

7 files changed

+685
-6
lines changed

7 files changed

+685
-6
lines changed

homeassistant/components/ruuvitag_ble/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"dependencies": ["bluetooth_adapters"],
1717
"documentation": "https://www.home-assistant.io/integrations/ruuvitag_ble",
1818
"iot_class": "local_push",
19-
"requirements": ["ruuvitag-ble==0.2.1"]
19+
"requirements": ["ruuvitag-ble==0.3.0"]
2020
}

homeassistant/components/ruuvitag_ble/sensor.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,25 @@
104104
state_class=SensorStateClass.MEASUREMENT,
105105
entity_registry_enabled_default=False,
106106
),
107-
# Keys exported for dataformat 06 sensors in newer versions of ruuvitag-ble
107+
# Keys exported for dataformat 06/e1 sensors in newer versions of ruuvitag-ble
108+
"pm1": SensorEntityDescription(
109+
key=f"{SSDSensorDeviceClass.PM1}_{Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER}",
110+
device_class=SensorDeviceClass.PM1,
111+
native_unit_of_measurement=Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
112+
state_class=SensorStateClass.MEASUREMENT,
113+
),
114+
"pm4": SensorEntityDescription(
115+
key=f"{SSDSensorDeviceClass.PM4}_{Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER}",
116+
device_class=SensorDeviceClass.PM4,
117+
native_unit_of_measurement=Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
118+
state_class=SensorStateClass.MEASUREMENT,
119+
),
120+
"pm10": SensorEntityDescription(
121+
key=f"{SSDSensorDeviceClass.PM10}_{Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER}",
122+
device_class=SensorDeviceClass.PM10,
123+
native_unit_of_measurement=Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
124+
state_class=SensorStateClass.MEASUREMENT,
125+
),
108126
"pm25": SensorEntityDescription(
109127
key=f"{SSDSensorDeviceClass.PM25}_{Units.CONCENTRATION_MICROGRAMS_PER_CUBIC_METER}",
110128
device_class=SensorDeviceClass.PM25,

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/ruuvitag_ble/fixtures.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,19 @@
3434
service_uuids=[],
3535
source="local",
3636
)
37+
RUUVI_E1_SERVICE_INFO = BluetoothServiceInfo(
38+
name="Ruuvi Air 1234",
39+
address="01:03:05:07:12:34", # Ignored (the payload encodes the correct MAC)
40+
rssi=-60,
41+
manufacturer_data={
42+
1177: bytes.fromhex(
43+
"E1170C5668C79E0065007004BD11CA00C90A0213E0AC000000DECDEE110000000000CBB8334C884F"
44+
),
45+
},
46+
service_data={},
47+
service_uuids=[],
48+
source="local",
49+
)
50+
3751
CONFIGURED_NAME = "RuuviTag EFAF"
3852
CONFIGURED_PREFIX = "ruuvitag_efaf"

0 commit comments

Comments
 (0)