Skip to content

Commit

Permalink
Merge pull request #8 from dronenb/master
Browse files Browse the repository at this point in the history
Fix device entities and update version
  • Loading branch information
dcramer committed Aug 4, 2023
2 parents c656223 + d863e4b commit 52d87a6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion custom_components/luxor/const.py
Expand Up @@ -2,7 +2,7 @@
NAME = "FXLuminaire Luxor"
DOMAIN = "luxor"
DOMAIN_DATA = f"{DOMAIN}_data"
VERSION = "0.0.1"
VERSION = "0.0.2"
ISSUE_URL = "https://github.com/dcramer/hass-luxor/issues"

# Platforms
Expand Down
14 changes: 8 additions & 6 deletions custom_components/luxor/light.py
Expand Up @@ -10,6 +10,7 @@
)
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
Expand Down Expand Up @@ -112,7 +113,7 @@ def __init__(self, coordinator, controller, group_id, name, intensity, color):
self.group_id = group_id
self.intensity = intensity
self.color = color

self._attr_unique_id = "{}{}".format(name, group_id)
self._attr_name = name

async def async_turn_on(
Expand Down Expand Up @@ -150,8 +151,9 @@ def is_on(self):

@property
def device_info(self):
return {
"identifiers": ("{}_{}".format(DOMAIN, LIGHT), self.group_id),
"name": self.name,
"via_device": (DOMAIN, self.controller.name),
}
return DeviceInfo(
identifiers={("{}_{}".format(DOMAIN, LIGHT), self.group_id)},
manufacturer="FXLuminaire",
name=self.name,
via_device=(DOMAIN, self.controller.name),
)
2 changes: 1 addition & 1 deletion custom_components/luxor/manifest.json
Expand Up @@ -10,5 +10,5 @@
"requirements": [
"luxor-openapi-asyncio==0.1.0"
],
"version": "0.0.0"
"version": "0.0.2"
}
12 changes: 6 additions & 6 deletions custom_components/luxor/scene.py
Expand Up @@ -7,6 +7,7 @@
from homeassistant.components.scene import Scene
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
DataUpdateCoordinator,
Expand Down Expand Up @@ -98,7 +99,7 @@ def __init__(self, controller, theme_index, name, on_off):
self.theme_index = theme_index

self._attr_name = name

self._attr_unique_id = "{}{}".format(name, theme_index)
async def async_activate(self, **kwargs): # pylint: disable=unused-argument
api_instance = themes_api.ThemesApi(self.controller.api)
# TODO: handle non-0 status codes
Expand All @@ -108,8 +109,7 @@ async def async_activate(self, **kwargs): # pylint: disable=unused-argument

@property
def device_info(self):
return {
"identifiers": ("{}_{}".format(DOMAIN, SCENE), self.theme_index),
"name": self.name,
"via_device": (DOMAIN, self.controller.name),
}
return DeviceInfo(
identifiers={(DOMAIN, self.controller.name)},
name=self.controller.name,
)

0 comments on commit 52d87a6

Please sign in to comment.