Skip to content

Commit effe3a4

Browse files
committed
Add CIRCLEPLUS NodeFeature
1 parent b29517b commit effe3a4

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

plugwise_usb/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class NodeFeature(str, Enum):
5454
SWITCH = "switch"
5555
SENSE = "sense"
5656
TEMPERATURE = "temperature"
57+
CIRCLEPLUS = "circleplus"
5758

5859

5960
class NodeType(Enum):
@@ -83,6 +84,7 @@ class NodeType(Enum):
8384
NodeFeature.TEMPERATURE,
8485
NodeFeature.SENSE,
8586
NodeFeature.SWITCH,
87+
NodeFeature.CIRCLEPLUS,
8688
)
8789

8890

plugwise_usb/nodes/circle_plus.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..messages.responses import NodeResponseType
1515
from .circle import PlugwiseCircle
1616
from .helpers.firmware import CIRCLE_PLUS_FIRMWARE_SUPPORT
17-
17+
from .helpers import raise_not_loaded
1818
_LOGGER = logging.getLogger(__name__)
1919

2020

@@ -37,6 +37,7 @@ async def load(self) -> bool:
3737
NodeFeature.RELAY_LOCK,
3838
NodeFeature.ENERGY,
3939
NodeFeature.POWER,
40+
NodeFeature.CIRCLEPLUS,
4041
),
4142
)
4243
if await self.initialize():
@@ -121,3 +122,18 @@ async def clock_synchronize(self) -> bool:
121122
self.name,
122123
)
123124
return False
125+
126+
@raise_not_loaded
127+
async def enable_auto_join(self) -> bool:
128+
"""Enable Auto Join."""
129+
_LOGGER.warning("Auto Joining Started")
130+
return True
131+
132+
# region properties
133+
@property
134+
def auto_join(self) -> bool:
135+
"""Auto Join Attribute."""
136+
_LOGGER.warning("Auto Joining Started")
137+
return True
138+
139+
# end region

plugwise_usb/nodes/helpers/firmware.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ class SupportedVersions(NamedTuple):
167167
NodeFeature.MOTION: 2.0,
168168
NodeFeature.MOTION_CONFIG: 2.0,
169169
NodeFeature.SWITCH: 2.0,
170+
NodeFeature.CIRCLEPLUS: 2.0,
170171
}
171172

172173
# endregion

plugwise_usb/nodes/node.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,15 @@ def sense(self) -> SenseStatistics:
320320
f"Sense statistics is not supported for node {self.mac}"
321321
)
322322

323+
@property
324+
@raise_not_loaded
325+
def auto_join(self) -> bool:
326+
"""Enable Auto Join."""
327+
if NodeFeature.CIRCLEPLUS not in self._features:
328+
raise FeatureError(f"Auto-Joining is not supported for node {self.mac}")
329+
raise NotImplementedError()
330+
331+
323332
# endregion
324333

325334
def _setup_protocol(

0 commit comments

Comments
 (0)