Add raw sensor to BTHome (#101412)

This commit is contained in:
Ernst Klamer 2023-10-06 10:22:51 +02:00 committed by GitHub
parent d009ff8b01
commit fa90b0f41e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 3 deletions

View File

@ -20,5 +20,5 @@
"dependencies": ["bluetooth_adapters"],
"documentation": "https://www.home-assistant.io/integrations/bthome",
"iot_class": "local_push",
"requirements": ["bthome-ble==3.1.1"]
"requirements": ["bthome-ble==3.2.0"]
}

View File

@ -228,6 +228,10 @@ SENSOR_DESCRIPTIONS = {
native_unit_of_measurement=UnitOfPressure.MBAR,
state_class=SensorStateClass.MEASUREMENT,
),
# Raw (-)
(BTHomeExtendedSensorDeviceClass.RAW, None): SensorEntityDescription(
key=str(BTHomeExtendedSensorDeviceClass.RAW),
),
# Rotation (°)
(BTHomeSensorDeviceClass.ROTATION, Units.DEGREE): SensorEntityDescription(
key=f"{BTHomeSensorDeviceClass.ROTATION}_{Units.DEGREE}",

View File

@ -581,7 +581,7 @@ brunt==1.2.0
bt-proximity==0.2.1
# homeassistant.components.bthome
bthome-ble==3.1.1
bthome-ble==3.2.0
# homeassistant.components.bt_home_hub_5
bthomehub5-devicelist==0.1.1

View File

@ -488,7 +488,7 @@ brottsplatskartan==0.0.1
brunt==1.2.0
# homeassistant.components.bthome
bthome-ble==3.1.1
bthome-ble==3.2.0
# homeassistant.components.buienradar
buienradar==1.0.5

View File

@ -957,6 +957,21 @@ async def test_v1_sensors(
},
],
),
(
"A4:C1:38:8D:18:B2",
make_bthome_v2_adv(
"A4:C1:38:8D:18:B2",
b"\x44\x54\x0C\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x21",
),
None,
[
{
"sensor_entity": "sensor.test_device_18b2_raw",
"friendly_name": "Test Device 18B2 Raw",
"expected_state": "48656c6c6f20576f726c6421",
},
],
),
(
"A4:C1:38:8D:18:B2",
make_bthome_v2_adv(