Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #120 from thomasgermain/2022_02_compatibility
Browse files Browse the repository at this point in the history
2022.02 compatibility + att fan speed to attributes
  • Loading branch information
thomasgermain committed Feb 12, 2022
2 parents aeaa242 + 20b7092 commit 4603772
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
14 changes: 12 additions & 2 deletions custom_components/multimatic/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
from __future__ import annotations

import logging
from typing import Any
from typing import Any, Mapping

from pymultimatic.model import OperatingModes, QuickModes

from homeassistant.components.fan import DOMAIN, SUPPORT_PRESET_MODE, FanEntity
from homeassistant.components.fan import (
DOMAIN,
SUPPORT_PRESET_MODE,
FanEntity,
ATTR_SPEED,
)
from homeassistant.helpers import entity_platform

from .const import ATTR_LEVEL, VENTILATION
Expand Down Expand Up @@ -144,3 +149,8 @@ async def set_ventilation_day_level(self, **kwargs):
async def set_ventilation_night_level(self, **kwargs):
"""Service method to set night level."""
await self.coordinator.api.set_fan_night_level(self, kwargs.get(ATTR_LEVEL))

@property
def extra_state_attributes(self) -> Mapping[str, Any] | None:
"""Return entity specific state attributes."""
return {ATTR_SPEED: self.active_mode.target}
2 changes: 1 addition & 1 deletion custom_components/multimatic/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"codeowners": [
"@thomasgermain"
],
"version": "1.12.0",
"version": "1.12.2",
"iot_class": "cloud_polling"
}
5 changes: 2 additions & 3 deletions custom_components/multimatic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

import datetime
import logging

from pymultimatic.model import EmfReport, Report
Expand All @@ -20,7 +19,6 @@
TEMP_CELSIUS,
)
from homeassistant.helpers.typing import StateType
from homeassistant.util.dt import utc_from_timestamp

from .const import EMF_REPORTS, OUTDOOR_TEMP, REPORTS
from .coordinator import MultimaticCoordinator
Expand All @@ -31,7 +29,8 @@

UNIT_TO_DEVICE_CLASS = {
"bar": SensorDeviceClass.PRESSURE,
"ppm": "",
"ppm": SensorDeviceClass.CO2,
"Wh": SensorDeviceClass.ENERGY,
"°C": SensorDeviceClass.TEMPERATURE,
}

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": "multimatic",
"domains": ["binary_sensor", "climate", "fan", "sensor", "water_heater"],
"render_readme": true,
"homeassistant": "2021.12.0"
"homeassistant": "2022.02.0"
}

0 comments on commit 4603772

Please sign in to comment.