Skip to content

Commit 318f934

Browse files
authored
Merge pull request #4 from dmamontov/version/2.0.0
Upgrade HASS version
2 parents f6c9ac1 + 58e5c83 commit 318f934

File tree

11 files changed

+38
-18
lines changed

11 files changed

+38
-18
lines changed

custom_components/tattelecom_intercom/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ async def async_start(with_sleep: bool = False) -> None:
7272
if with_sleep:
7373
await asyncio.sleep(DEFAULT_SLEEP)
7474

75-
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
75+
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
7676

7777
if is_new:
7878
await async_start()

custom_components/tattelecom_intercom/binary_sensor.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async def async_setup_entry(
5959
async_add_entities(entities)
6060

6161

62+
# pylint: disable=too-many-ancestors
6263
class IntercomBinarySensor(IntercomEntity, BinarySensorEntity):
6364
"""Intercom binary sensor entry."""
6465

custom_components/tattelecom_intercom/button.py

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
)
7272

7373

74+
# pylint: disable=too-many-ancestors
7475
async def async_setup_entry(
7576
hass: HomeAssistant,
7677
config_entry: ConfigEntry,

custom_components/tattelecom_intercom/camera.py

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ def add_camera(entity: IntercomEntityDescription) -> None:
115115
)
116116

117117

118+
# pylint: disable=too-many-ancestors
118119
class IntercomCamera(IntercomEntity, GenericCamera):
119120
"""Intercom camera entry."""
120121

custom_components/tattelecom_intercom/const.py

-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
Platform.MEDIA_PLAYER,
2222
]
2323

24-
DEVICE_CLASS_SIP_STATE: Final = f"{DOMAIN}__sip_state"
25-
DEVICE_CLASS_CALL_STATE: Final = f"{DOMAIN}__call_state"
26-
2724
"""Diagnostic const"""
2825
DIAGNOSTIC_DATE_TIME: Final = "date_time"
2926
DIAGNOSTIC_MESSAGE: Final = "message"

custom_components/tattelecom_intercom/enum.py

+11
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66

77
from enum import Enum, IntEnum
88

9+
from homeassistant.backports.enum import StrEnum
10+
11+
from custom_components.tattelecom_intercom.const import DOMAIN
12+
13+
14+
class DeviceClass(StrEnum):
15+
"""DeviceClass enum"""
16+
17+
SIP_STATE = f"{DOMAIN}__sip_state"
18+
CALL_STATE = f"{DOMAIN}__call_state"
19+
920

1021
class Method(str, Enum):
1122
"""Method enum"""
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
{
22
"domain": "tattelecom_intercom",
33
"name": "Tattelecom Intercom / Таттелеком Домофон",
4-
"version": "1.1.0",
5-
"documentation": "https://github.com/dmamontov/hass-tattelecom-intercom/wiki",
6-
"issue_tracker": "https://github.com/dmamontov/hass-tattelecom-intercom/issues",
4+
"codeowners": [
5+
"@dmamontov"
6+
],
77
"config_flow": true,
8-
"requirements": ["httpx[http2]"],
9-
"dependencies": ["generic", "ffmpeg", "http"],
10-
"codeowners": ["@dmamontov"],
8+
"dependencies": [
9+
"generic",
10+
"ffmpeg",
11+
"http"
12+
],
13+
"documentation": "https://github.com/dmamontov/hass-tattelecom-intercom/wiki",
1114
"iot_class": "cloud_polling",
12-
"quality_scale": "platinum"
13-
}
15+
"issue_tracker": "https://github.com/dmamontov/hass-tattelecom-intercom/issues",
16+
"quality_scale": "platinum",
17+
"requirements": [
18+
"httpx[http2]"
19+
],
20+
"version": "2.0.0"
21+
}

custom_components/tattelecom_intercom/media_player.py

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ async def async_setup_entry(
7878
async_add_entities(entities)
7979

8080

81+
# pylint: disable=too-many-ancestors
8182
class IntercomMediaPlayer(IntercomEntity, MediaPlayerEntity):
8283
"""Intercom media player entry."""
8384

custom_components/tattelecom_intercom/sensor.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
from .const import (
2323
ATTR_UPDATE_STATE,
24-
DEVICE_CLASS_CALL_STATE,
25-
DEVICE_CLASS_SIP_STATE,
2624
SENSOR_CALL_STATE,
2725
SENSOR_CALL_STATE_NAME,
2826
SENSOR_SIP_STATE,
@@ -31,7 +29,7 @@
3129
SIGNAL_SIP_STATE,
3230
)
3331
from .entity import IntercomEntity
34-
from .enum import CallState, VoipState
32+
from .enum import CallState, VoipState, DeviceClass
3533
from .updater import IntercomUpdater, async_get_updater
3634

3735
PARALLEL_UPDATES = 0
@@ -54,7 +52,7 @@
5452
key=SENSOR_SIP_STATE,
5553
name=SENSOR_SIP_STATE_NAME,
5654
icon="mdi:phone-voip",
57-
device_class=DEVICE_CLASS_SIP_STATE,
55+
device_class=DeviceClass.SIP_STATE,
5856
entity_category=EntityCategory.DIAGNOSTIC,
5957
entity_registry_enabled_default=True,
6058
),
@@ -63,7 +61,7 @@
6361
name=SENSOR_CALL_STATE_NAME,
6462
icon=ICONS[SENSOR_CALL_STATE][CallState.ENDED.value],
6563
entity_category=EntityCategory.DIAGNOSTIC,
66-
device_class=DEVICE_CLASS_CALL_STATE,
64+
device_class=DeviceClass.CALL_STATE,
6765
entity_registry_enabled_default=True,
6866
),
6967
)
@@ -94,6 +92,7 @@ async def async_setup_entry(
9492
async_add_entities(entities)
9593

9694

95+
# pylint: disable=too-many-ancestors
9796
class IntercomSensor(IntercomEntity, SensorEntity):
9897
"""Intercom sensor entry."""
9998

custom_components/tattelecom_intercom/switch.py

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def add_switch(entity: IntercomEntityDescription) -> None:
7272
)
7373

7474

75+
# pylint: disable=too-many-ancestors
7576
class IntercomSwitch(IntercomEntity, SwitchEntity):
7677
"""Intercom switch entry."""
7778

hacs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Tattelecom Intercom / Таттелеком Домофон",
33
"render_readme": true,
4-
"homeassistant": "2022.4.0",
4+
"homeassistant": "2023.0.0",
55
"country": "ru"
66
}

0 commit comments

Comments
 (0)