Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring transmit power on TI Z-Stack routers #1886

Merged
merged 2 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions zhaquirks/texasinstruments/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Texas Instruments devices."""
69 changes: 69 additions & 0 deletions zhaquirks/texasinstruments/router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""Texas Instruments Z-Stack router device."""
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, GreenPowerProxy, Identify

from zhaquirks import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)


class BasicCluster(CustomCluster, Basic):
"""Texas Instruments Basic cluster."""

attributes = Basic.attributes.copy()
attributes[0x1337] = ("transmit_power", t.int8s, False)


class TiRouter(CustomDevice):
"""Texas Instruments Z-Stack router device."""

signature = {
MODELS_INFO: [("TexasInstruments", "ti.router")],
ENDPOINTS: {
8: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: 0x00FF,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
],
OUTPUT_CLUSTERS: [
Basic.cluster_id,
],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
8: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: 0x00FF,
INPUT_CLUSTERS: [
BasicCluster,
Identify.cluster_id,
],
OUTPUT_CLUSTERS: [
BasicCluster,
],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}