Skip to content

Commit 7055276

Browse files
authored
Allign naming of Reolink host switch entities (home-assistant#153494)
1 parent 71b3ebd commit 7055276

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

homeassistant/components/reolink/switch.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class ReolinkSwitchEntityDescription(
3939

4040

4141
@dataclass(frozen=True, kw_only=True)
42-
class ReolinkNVRSwitchEntityDescription(
42+
class ReolinkHostSwitchEntityDescription(
4343
SwitchEntityDescription,
4444
ReolinkHostEntityDescription,
4545
):
46-
"""A class that describes NVR switch entities."""
46+
"""A class that describes host switch entities."""
4747

4848
method: Callable[[Host, bool], Any]
4949
value: Callable[[Host], bool]
@@ -245,8 +245,8 @@ class ReolinkChimeSwitchEntityDescription(
245245
),
246246
)
247247

248-
NVR_SWITCH_ENTITIES = (
249-
ReolinkNVRSwitchEntityDescription(
248+
HOST_SWITCH_ENTITIES = (
249+
ReolinkHostSwitchEntityDescription(
250250
key="email",
251251
cmd_key="GetEmail",
252252
translation_key="email",
@@ -255,7 +255,7 @@ class ReolinkChimeSwitchEntityDescription(
255255
value=lambda api: api.email_enabled(),
256256
method=lambda api, value: api.set_email(None, value),
257257
),
258-
ReolinkNVRSwitchEntityDescription(
258+
ReolinkHostSwitchEntityDescription(
259259
key="ftp_upload",
260260
cmd_key="GetFtp",
261261
translation_key="ftp_upload",
@@ -264,7 +264,7 @@ class ReolinkChimeSwitchEntityDescription(
264264
value=lambda api: api.ftp_enabled(),
265265
method=lambda api, value: api.set_ftp(None, value),
266266
),
267-
ReolinkNVRSwitchEntityDescription(
267+
ReolinkHostSwitchEntityDescription(
268268
key="push_notifications",
269269
cmd_key="GetPush",
270270
translation_key="push_notifications",
@@ -273,7 +273,7 @@ class ReolinkChimeSwitchEntityDescription(
273273
value=lambda api: api.push_enabled(),
274274
method=lambda api, value: api.set_push(None, value),
275275
),
276-
ReolinkNVRSwitchEntityDescription(
276+
ReolinkHostSwitchEntityDescription(
277277
key="record",
278278
cmd_key="GetRec",
279279
translation_key="record",
@@ -282,7 +282,7 @@ class ReolinkChimeSwitchEntityDescription(
282282
value=lambda api: api.recording_enabled(),
283283
method=lambda api, value: api.set_recording(None, value),
284284
),
285-
ReolinkNVRSwitchEntityDescription(
285+
ReolinkHostSwitchEntityDescription(
286286
key="buzzer",
287287
cmd_key="GetBuzzerAlarmV20",
288288
translation_key="hub_ringtone_on_event",
@@ -320,8 +320,8 @@ async def async_setup_entry(
320320
if entity_description.supported(reolink_data.host.api, channel)
321321
]
322322
entities.extend(
323-
ReolinkNVRSwitchEntity(reolink_data, entity_description)
324-
for entity_description in NVR_SWITCH_ENTITIES
323+
ReolinkHostSwitchEntity(reolink_data, entity_description)
324+
for entity_description in HOST_SWITCH_ENTITIES
325325
if entity_description.supported(reolink_data.host.api)
326326
)
327327
entities.extend(
@@ -373,15 +373,15 @@ async def async_turn_off(self, **kwargs: Any) -> None:
373373
self.async_write_ha_state()
374374

375375

376-
class ReolinkNVRSwitchEntity(ReolinkHostCoordinatorEntity, SwitchEntity):
377-
"""Switch entity class for Reolink NVR features."""
376+
class ReolinkHostSwitchEntity(ReolinkHostCoordinatorEntity, SwitchEntity):
377+
"""Switch entity class for Reolink host features."""
378378

379-
entity_description: ReolinkNVRSwitchEntityDescription
379+
entity_description: ReolinkHostSwitchEntityDescription
380380

381381
def __init__(
382382
self,
383383
reolink_data: ReolinkData,
384-
entity_description: ReolinkNVRSwitchEntityDescription,
384+
entity_description: ReolinkHostSwitchEntityDescription,
385385
) -> None:
386386
"""Initialize Reolink switch entity."""
387387
self.entity_description = entity_description

0 commit comments

Comments
 (0)