File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class NodeFeature(str, Enum):
4141
4242 AVAILABLE = "available"
4343 BATTERY = "battery"
44+ CIRCLEPLUS = "circleplus"
4445 ENERGY = "energy"
4546 HUMIDITY = "humidity"
4647 INFO = "info"
@@ -54,7 +55,6 @@ class NodeFeature(str, Enum):
5455 SWITCH = "switch"
5556 SENSE = "sense"
5657 TEMPERATURE = "temperature"
57- CIRCLEPLUS = "circleplus"
5858
5959
6060class NodeType (Enum ):
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ async def load(self) -> bool:
7575 NodeFeature .RELAY_LOCK ,
7676 NodeFeature .ENERGY ,
7777 NodeFeature .POWER ,
78+ NodeFeature .CIRCLEPLUS ,
7879 ),
7980 )
8081 if not await self .initialize ():
@@ -126,7 +127,16 @@ async def clock_synchronize(self) -> bool:
126127
127128 @raise_not_loaded
128129 async def enable_auto_join (self ) -> bool :
129- """Enable Auto Join."""
130- _LOGGER .info ("Allow Auto Joining Enabled" )
131- allow_auto_join_request = CirclePlusAllowJoiningRequest (self ._send , True )
132- return await allow_auto_join_request .send ()
130+ """Enable auto-join on the Circle+.
131+
132+ Returns:
133+ bool: True if the request was acknowledged, False otherwise.
134+ """
135+ _LOGGER .info ("Enabling auto-join for CirclePlus" )
136+ request = CirclePlusAllowJoiningRequest (self ._send , True )
137+ response = await request .send ()
138+ if response is None :
139+ return False
140+
141+ # JOIN_ACCEPTED is the ACK for enable=True
142+ return NodeResponseType (response .ack_id ) == NodeResponseType .JOIN_ACCEPTED
You can’t perform that action at this time.
0 commit comments