Support for Insteon 4 button KeypadLink device (#100132)
This commit is contained in:
parent
d417a27c85
commit
f9ce315d1b
6 changed files with 28 additions and 8 deletions
|
@ -3,7 +3,12 @@
|
|||
from typing import Any
|
||||
|
||||
from pyinsteon import devices
|
||||
from pyinsteon.config import RADIO_BUTTON_GROUPS, RAMP_RATE_IN_SEC, get_usable_value
|
||||
from pyinsteon.config import (
|
||||
LOAD_BUTTON,
|
||||
RADIO_BUTTON_GROUPS,
|
||||
RAMP_RATE_IN_SEC,
|
||||
get_usable_value,
|
||||
)
|
||||
from pyinsteon.constants import (
|
||||
RAMP_RATES_SEC,
|
||||
PropertyType,
|
||||
|
@ -75,8 +80,11 @@ def get_schema(prop, name, groups):
|
|||
if name == RAMP_RATE_IN_SEC:
|
||||
return _list_schema(name, RAMP_RATE_LIST)
|
||||
if name == RADIO_BUTTON_GROUPS:
|
||||
button_list = {str(group): groups[group].name for group in groups if group != 1}
|
||||
button_list = {str(group): groups[group].name for group in groups}
|
||||
return _multi_select_schema(name, button_list)
|
||||
if name == LOAD_BUTTON:
|
||||
button_list = {group: groups[group].name for group in groups}
|
||||
return _list_schema(name, button_list)
|
||||
if prop.value_type == bool:
|
||||
return _bool_schema(name)
|
||||
if prop.value_type == int:
|
||||
|
|
|
@ -10,6 +10,7 @@ from pyinsteon.device_types.ipdb import (
|
|||
DimmableLightingControl_Dial,
|
||||
DimmableLightingControl_DinRail,
|
||||
DimmableLightingControl_FanLinc,
|
||||
DimmableLightingControl_I3_KeypadLinc_4,
|
||||
DimmableLightingControl_InLineLinc01,
|
||||
DimmableLightingControl_InLineLinc02,
|
||||
DimmableLightingControl_KeypadLinc_6,
|
||||
|
@ -55,6 +56,9 @@ DEVICE_PLATFORM: dict[Device, dict[Platform, Iterable[int]]] = {
|
|||
DimmableLightingControl_FanLinc: {Platform.LIGHT: [1], Platform.FAN: [2]},
|
||||
DimmableLightingControl_InLineLinc01: {Platform.LIGHT: [1]},
|
||||
DimmableLightingControl_InLineLinc02: {Platform.LIGHT: [1]},
|
||||
DimmableLightingControl_I3_KeypadLinc_4: {
|
||||
Platform.LIGHT: [1, 2, 3, 4],
|
||||
},
|
||||
DimmableLightingControl_KeypadLinc_6: {
|
||||
Platform.LIGHT: [1],
|
||||
Platform.SWITCH: [3, 4, 5, 6],
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
from typing import Any
|
||||
|
||||
from pyinsteon.config import ON_LEVEL
|
||||
from pyinsteon.device_types.device_base import Device as InsteonDevice
|
||||
|
||||
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
|
@ -51,6 +52,13 @@ class InsteonDimmerEntity(InsteonEntity, LightEntity):
|
|||
_attr_color_mode = ColorMode.BRIGHTNESS
|
||||
_attr_supported_color_modes = {ColorMode.BRIGHTNESS}
|
||||
|
||||
def __init__(self, device: InsteonDevice, group: int) -> None:
|
||||
"""Init the InsteonDimmerEntity entity."""
|
||||
super().__init__(device=device, group=group)
|
||||
if not self._insteon_device_group.is_dimmable:
|
||||
self._attr_color_mode = ColorMode.ONOFF
|
||||
self._attr_supported_color_modes = {ColorMode.ONOFF}
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
"""Return the brightness of this light between 0..255."""
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
"iot_class": "local_push",
|
||||
"loggers": ["pyinsteon", "pypubsub"],
|
||||
"requirements": [
|
||||
"pyinsteon==1.4.3",
|
||||
"insteon-frontend-home-assistant==0.3.5"
|
||||
"pyinsteon==1.5.1",
|
||||
"insteon-frontend-home-assistant==0.4.0"
|
||||
],
|
||||
"usb": [
|
||||
{
|
||||
|
|
|
@ -1064,7 +1064,7 @@ influxdb==5.3.1
|
|||
inkbird-ble==0.5.6
|
||||
|
||||
# homeassistant.components.insteon
|
||||
insteon-frontend-home-assistant==0.3.5
|
||||
insteon-frontend-home-assistant==0.4.0
|
||||
|
||||
# homeassistant.components.intellifire
|
||||
intellifire4py==2.2.2
|
||||
|
@ -1750,7 +1750,7 @@ pyialarm==2.2.0
|
|||
pyicloud==1.0.0
|
||||
|
||||
# homeassistant.components.insteon
|
||||
pyinsteon==1.4.3
|
||||
pyinsteon==1.5.1
|
||||
|
||||
# homeassistant.components.intesishome
|
||||
pyintesishome==1.8.0
|
||||
|
|
|
@ -832,7 +832,7 @@ influxdb==5.3.1
|
|||
inkbird-ble==0.5.6
|
||||
|
||||
# homeassistant.components.insteon
|
||||
insteon-frontend-home-assistant==0.3.5
|
||||
insteon-frontend-home-assistant==0.4.0
|
||||
|
||||
# homeassistant.components.intellifire
|
||||
intellifire4py==2.2.2
|
||||
|
@ -1302,7 +1302,7 @@ pyialarm==2.2.0
|
|||
pyicloud==1.0.0
|
||||
|
||||
# homeassistant.components.insteon
|
||||
pyinsteon==1.4.3
|
||||
pyinsteon==1.5.1
|
||||
|
||||
# homeassistant.components.ipma
|
||||
pyipma==3.0.6
|
||||
|
|
Loading…
Add table
Reference in a new issue