Skip to content

Commit

Permalink
Merge pull request #9 from bipsendk/master
Browse files Browse the repository at this point in the history
Fixup for energy measurement (wrong type) and 2024.6 compatibility
  • Loading branch information
chkuendig authored Jun 18, 2024
2 parents ea92578 + a3ec9f1 commit c963481
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion custom_components/amphiro_ble/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _convert_advertisement(
data = {
(DeviceClass.COUNT,None):startCounter,
(DeviceClass.TEMPERATURE, UnitOfTemperature.CELSIUS): temp,
(DeviceClass.POWER, Units.POWER_KILO_WATT): kwatts,
(DeviceClass.ENERGY, Units.ENERGY_KILO_WATT_HOUR): kwatts,
(DeviceClass.TIME, UnitOfTime.SECONDS):secs,
(DeviceClass.VOLUME_DISPENSED,Units.VOLUME_LITERS):round( pulses/2560, 2)

Expand Down
4 changes: 1 addition & 3 deletions custom_components/amphiro_ble/sensor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Support for Amphiro sensors."""
from __future__ import annotations

from typing import Optional, Union

from sensor_state_data import (
DeviceKey,
DeviceClass,
Expand Down Expand Up @@ -129,7 +127,7 @@ async def async_setup_entry(

class AmphiroBluetoothSensorEntity(
PassiveBluetoothProcessorEntity[
PassiveBluetoothDataProcessor[Optional[Union[float, int]]]
PassiveBluetoothDataProcessor[float | int | None, SensorUpdate]
],
SensorEntity,
):
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"name": "Amphiro Digital Hand Shower BLE",
"hacs": "1.6.0",
"render_readme":true,
"homeassistant": "2022.12.0"
"homeassistant": "2024.6.0"
}

0 comments on commit c963481

Please sign in to comment.