Skip to content

Commit 6fdfc55

Browse files
LaStradafrenck
authored andcommitted
Bump airthings_ble to 0.7.1 (#113172)
Co-authored-by: Ståle Storø Hauknes <[email protected]>
1 parent 962e5ec commit 6fdfc55

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

homeassistant/components/airthings_ble/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
2727
hass.data.setdefault(DOMAIN, {})
2828
address = entry.unique_id
2929

30-
elevation = hass.config.elevation
3130
is_metric = hass.config.units is METRIC_SYSTEM
3231
assert address is not None
3332

@@ -40,7 +39,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
4039
f"Could not find Airthings device with address {address}"
4140
)
4241

43-
airthings = AirthingsBluetoothDeviceData(_LOGGER, elevation, is_metric)
42+
airthings = AirthingsBluetoothDeviceData(_LOGGER, is_metric)
4443

4544
async def _async_update_method() -> AirthingsDevice:
4645
"""Get data from Airthings BLE."""

homeassistant/components/airthings_ble/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
"dependencies": ["bluetooth_adapters"],
2525
"documentation": "https://www.home-assistant.io/integrations/airthings_ble",
2626
"iot_class": "local_polling",
27-
"requirements": ["airthings-ble==0.6.1"]
27+
"requirements": ["airthings-ble==0.7.1"]
2828
}

homeassistant/components/airthings_ble/sensor.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from homeassistant.const import (
1717
CONCENTRATION_PARTS_PER_BILLION,
1818
CONCENTRATION_PARTS_PER_MILLION,
19-
LIGHT_LUX,
2019
PERCENTAGE,
2120
EntityCategory,
2221
Platform,
@@ -106,8 +105,7 @@
106105
),
107106
"illuminance": SensorEntityDescription(
108107
key="illuminance",
109-
device_class=SensorDeviceClass.ILLUMINANCE,
110-
native_unit_of_measurement=LIGHT_LUX,
108+
native_unit_of_measurement=PERCENTAGE,
111109
state_class=SensorStateClass.MEASUREMENT,
112110
),
113111
}
@@ -222,7 +220,7 @@ def __init__(
222220
manufacturer=airthings_device.manufacturer,
223221
hw_version=airthings_device.hw_version,
224222
sw_version=airthings_device.sw_version,
225-
model=airthings_device.model,
223+
model=airthings_device.model.name,
226224
)
227225

228226
@property

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ aioymaps==1.2.2
419419
airly==1.1.0
420420

421421
# homeassistant.components.airthings_ble
422-
airthings-ble==0.6.1
422+
airthings-ble==0.7.1
423423

424424
# homeassistant.components.airthings
425425
airthings-cloud==0.2.0

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ aioymaps==1.2.2
392392
airly==1.1.0
393393

394394
# homeassistant.components.airthings_ble
395-
airthings-ble==0.6.1
395+
airthings-ble==0.7.1
396396

397397
# homeassistant.components.airthings
398398
airthings-cloud==0.2.0

tests/components/airthings_ble/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
from unittest.mock import patch
55

6-
from airthings_ble import AirthingsBluetoothDeviceData, AirthingsDevice
6+
from airthings_ble import (
7+
AirthingsBluetoothDeviceData,
8+
AirthingsDevice,
9+
AirthingsDeviceType,
10+
)
711

812
from homeassistant.components.airthings_ble.const import DOMAIN
913
from homeassistant.components.bluetooth.models import BluetoothServiceInfoBleak
@@ -161,8 +165,7 @@ def patch_airthings_device_update():
161165
manufacturer="Airthings AS",
162166
hw_version="REV A",
163167
sw_version="G-BLE-1.5.3-master+0",
164-
model="Wave Plus",
165-
model_raw="2930",
168+
model=AirthingsDeviceType.WAVE_PLUS,
166169
name="Airthings Wave+",
167170
identifier="123456",
168171
sensors={

tests/components/airthings_ble/test_config_flow.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Test the Airthings BLE config flow."""
22
from unittest.mock import patch
33

4-
from airthings_ble import AirthingsDevice
4+
from airthings_ble import AirthingsDevice, AirthingsDeviceType
55
from bleak import BleakError
66

77
from homeassistant.components.airthings_ble.const import DOMAIN
@@ -28,8 +28,7 @@ async def test_bluetooth_discovery(hass: HomeAssistant) -> None:
2828
with patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
2929
AirthingsDevice(
3030
manufacturer="Airthings AS",
31-
model="Wave Plus",
32-
model_raw="2930",
31+
model=AirthingsDeviceType.WAVE_PLUS,
3332
name="Airthings Wave Plus",
3433
identifier="123456",
3534
)
@@ -111,8 +110,7 @@ async def test_user_setup(hass: HomeAssistant) -> None:
111110
), patch_async_ble_device_from_address(WAVE_SERVICE_INFO), patch_airthings_ble(
112111
AirthingsDevice(
113112
manufacturer="Airthings AS",
114-
model="Wave Plus",
115-
model_raw="2930",
113+
model=AirthingsDeviceType.WAVE_PLUS,
116114
name="Airthings Wave Plus",
117115
identifier="123456",
118116
)

0 commit comments

Comments
 (0)