|
17 | 17 | NodeRemoveRequest, |
18 | 18 | PlugwiseRequest, |
19 | 19 | ) |
20 | | -from ..messages.responses import PlugwiseResponse, StickResponseType |
| 20 | +from ..messages.responses import PlugwiseResponse #, StickResponseType |
21 | 21 | from .cache import NetworkRegistrationCache |
22 | 22 |
|
23 | 23 | _LOGGER = logging.getLogger(__name__) |
@@ -248,10 +248,11 @@ async def register_node(self, mac: str) -> int: |
248 | 248 | if not validate_mac(mac): |
249 | 249 | raise NodeError(f"MAC '{mac}' invalid") |
250 | 250 |
|
251 | | - request = NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True) |
252 | | - response = await request.send() |
253 | | - if response is None or response.ack_id != StickResponseType.ACCEPT: |
254 | | - raise NodeError(f"Failed to register node {mac}") |
| 251 | + #request = NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True) |
| 252 | + #response = await request.send() |
| 253 | + #if response is None or response.ack_id != StickResponseType.ACCEPT: |
| 254 | + # raise NodeError(f"Failed to register node {mac}") |
| 255 | + NodeAddRequest(self._send_to_controller, bytes(mac, UTF8), True) |
255 | 256 | self.update_network_registration(self._first_free_address, mac, None) |
256 | 257 | self._first_free_address += 1 |
257 | 258 | return self._first_free_address - 1 |
|
0 commit comments