Skip to content

Commit e2e5614

Browse files
committed
cleanup not needed property
add call to CirclePlusAllowJoinRequest from enable_auto_join function
1 parent edc3907 commit e2e5614

File tree

3 files changed

+4
-27
lines changed

3 files changed

+4
-27
lines changed

plugwise_usb/nodes/circle.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,6 @@ def relay_lock(self) -> RelayLock:
184184
"""State of the relay lock."""
185185
return self._relay_lock
186186

187-
@property
188-
@raise_not_loaded
189-
def auto_join(self) -> bool:
190-
"""Enable Auto Join."""
191-
if NodeFeature.CIRCLEPLUS not in self._features:
192-
raise FeatureError(
193-
f"Auto-Joining is not supported for node {self.mac}"
194-
)
195-
raise NotImplementedError()
196-
197187
# endregion
198188

199189
async def calibration_update(self) -> bool:

plugwise_usb/nodes/circle_plus.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from ..messages.requests import (
1111
CirclePlusRealTimeClockGetRequest,
1212
CirclePlusRealTimeClockSetRequest,
13+
CirclePlusAllowJoiningRequest,
1314
)
1415
from ..messages.responses import NodeResponseType
1516
from .circle import PlugwiseCircle
@@ -126,14 +127,9 @@ async def clock_synchronize(self) -> bool:
126127
@raise_not_loaded
127128
async def enable_auto_join(self) -> bool:
128129
"""Enable Auto Join."""
129-
_LOGGER.warning("Auto Joining Started")
130-
return True
130+
_LOGGER.warning("Enable Auto Joining Started")
131+
allow_auto_join_request = CirclePlusAllowJoiningRequest(self._send, True)
132+
return await allow_auto_join_request.send()
131133

132134
# region properties
133-
@property
134-
def auto_join(self) -> bool:
135-
"""Auto Join Attribute."""
136-
_LOGGER.warning("Auto Joining Started")
137-
return True
138-
139135
# end region

plugwise_usb/nodes/node.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,6 @@ 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-
332323
# endregion
333324

334325
def _setup_protocol(

0 commit comments

Comments
 (0)