Skip to content

Commit

Permalink
Fix Double Device Names For Entity #316
Browse files Browse the repository at this point in the history
  • Loading branch information
elahd authored Oct 23, 2023
1 parent 3c17639 commit dc2f80d
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 14 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ Where possible, use local control for smart home devices that are natively suppo

| Device Type | Actions | View Status | Low Battery Sub-Sensor | Malfunction Sub-Sensor | Configuration Options | Notes |
| ----------------- | ------------------------------------- | ----------- | ---------------------- | ---------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Alarm System | arm away, arm stay, arm night, disarm | | | | | |
| Sensor | _(none)_ | | | | | |
| Lock | lock, unlock | | | | | |
| Garage Door | open, close | | | | | |
| Gate | open, close | | | | | |
| Light | turn on / set brightness, turn off | | | | | |
| Thermostat | heat, cool, auto heat/cool, fan only | | | | | Fan only mode turns on the fan for the maximum duration available through Alarm.com. There is no option to turn on the fan for a shorter duration. Also, no support for remote temperature sensors. |
| Alarm System | arm away, arm stay, arm night, disarm || || | |
| Sensor | _(none)_ |||| | |
| Lock | lock, unlock |||| | |
| Garage Door | open, close || | | | |
| Gate | open, close || | | | |
| Light | turn on / set brightness, turn off || | | | |
| Thermostat | heat, cool, auto heat/cool, fan only |||| | Fan only mode turns on the fan for the maximum duration available through Alarm.com. There is no option to turn on the fan for a shorter duration. Also, no support for remote temperature sensors. |
| Skybell HD Camera | _(none)_ | | | | Indoor Chime On/Off, Outdoor Chime Volume, LED Brightness, Motion Sensor Sensitivity | No video support! |
| Water Sensor | _(none)_ | | | | | |
| Water Sensor | _(none)_ |||| | |

As of v0.2.0, multiples of all of the above devices are supported.

Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The alarmdotcom integration."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/alarm_control_panel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Interfaces with Alarm.com alarm control panels."""

from __future__ import annotations

import logging
Expand Down
8 changes: 5 additions & 3 deletions custom_components/alarmdotcom/base_device.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Base device."""

from __future__ import annotations

import contextlib
Expand All @@ -22,6 +23,7 @@
ATTRIB_BATTERY_NORMAL,
DEVICE_STATIC_ATTRIBUTES,
DOMAIN,
EVENT_LISTENER_BASE_DEVICE,
)
from .controller import AlarmIntegrationController

Expand Down Expand Up @@ -68,7 +70,7 @@ def device_type_name(self) -> str:
async def async_added_to_hass(self) -> None:
"""Register callbacks."""

self._device.register_external_update_callback(self._update_device_data)
self._device.register_external_update_callback(self._update_device_data, EVENT_LISTENER_BASE_DEVICE)

self._update_device_data()

Expand All @@ -79,7 +81,7 @@ async def async_will_remove_from_hass(self) -> None:

# This will fail for devices that were removed from ADC during this session.
with contextlib.suppress(ValueError):
self._device.unregister_external_update_callback(self._update_device_data)
self._device.unregister_external_update_callback(self._update_device_data, EVENT_LISTENER_BASE_DEVICE)

await super().async_will_remove_from_hass()

Expand Down Expand Up @@ -186,7 +188,7 @@ def __init__(

self._attr_unique_id = device.id_

self._attr_name = device.name
self._attr_name = None

super().__init__(controller, device)

Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/binary_sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA binary sensor."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/button.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA button."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/climate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA thermostat."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config flow to configure Alarmdotcom."""

from __future__ import annotations

import asyncio
Expand Down
4 changes: 3 additions & 1 deletion custom_components/alarmdotcom/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Const for the Alarmdotcom integration."""

from __future__ import annotations

import logging
Expand Down Expand Up @@ -75,7 +76,8 @@
]

DATA_CONTROLLER = "connection"
DATA_LISTENER = "listener"

EVENT_LISTENER_BASE_DEVICE = "Device Controller"

ATTRIB_BATTERY_NORMAL = "Normal"
ATTRIB_BATTERY_LOW = "Low"
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Controller interfaces with the Alarm.com API via pyalarmdotcomajax."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/cover.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA cover (garage door)."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/device_type_langs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Device Type Resolvers used via regex to determine whether a binary sensor is a window or a door."""

# Device Translations
LANG_DOOR = [
("afrikaans", "deur"),
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/light.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA light."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/lock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA lock."""

from __future__ import annotations

import logging
Expand Down
4 changes: 2 additions & 2 deletions custom_components/alarmdotcom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"integration_type": "hub",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/pyalarmdotcom/alarmdotcom/issues",
"requirements": ["beautifulsoup4>=4.10.0", "pyalarmdotcomajax==0.5.5"],
"version": "3.0.6"
"requirements": ["beautifulsoup4>=4.10.0", "pyalarmdotcomajax==0.5.6"],
"version": "3.0.7"
}
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/number.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA number."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/select.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA switch."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions custom_components/alarmdotcom/switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Alarmdotcom implementation of an HA switch."""

from __future__ import annotations

import logging
Expand Down

0 comments on commit dc2f80d

Please sign in to comment.