@@ -87,14 +87,14 @@ async def get_config(self, timeout: float = 2.0) -> Dict[str, int]:
8787 async def get_ccconf (self , timeout : float = 2.0 ) -> Dict [str , str ]:
8888 """CC1101 configuration registers (C0DnF). Returns a dictionary with the raw string."""
8989 # Response-Pattern aus 00_SIGNALduino.pm, Zeile 86, angepasst an Python regex
90- response = await self ._send_command (command = "C0DnF" , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C0Dn11= [a-f0-9]+' , re .IGNORECASE ))
90+ response = await self ._send_command (command = "C0DnF" , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C0Dn11\s*=\s* [a-f0-9]+' , re .IGNORECASE ))
9191 # Kapselt den rohen String, um die MQTT-Antwort konsistent als Dict zurückzugeben
9292 return {"cc1101_config_string" : response }
9393
9494 async def get_ccpatable (self , timeout : float = 2.0 ) -> str :
9595 """CC1101 PA table (C3E)"""
9696 # Response-Pattern aus 00_SIGNALduino.pm, Zeile 88
97- return await self ._send_command (command = "C3E" , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C3E\s=\s.*' ))
97+ return await self ._send_command (command = "C3E" , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C3E\s* =\s* .*' ))
9898
9999 async def factory_reset (self , timeout : float = 5.0 ) -> Dict [str , str ]:
100100 """Sets EEPROM defaults, effectively a factory reset (e).
@@ -133,7 +133,7 @@ async def _read_register_value(self, register_address: int) -> int:
133133 """Liest einen CC1101-Registerwert und gibt ihn als Integer zurück."""
134134 response = await self .read_cc1101_register (register_address )
135135 # Stellt sicher, dass wir nur den Wert nach 'C[A-Fa-f0-9]{2} = ' extrahieren
136- match = re .search (r'C[A-Fa-f0-9]{2}\s=\s([0-9A-Fa-f]+)' , response , re .IGNORECASE )
136+ match = re .search (r'C[A-Fa-f0-9]{2}\s* =\s* ([0-9A-Fa-f]+)' , response , re .IGNORECASE )
137137 if match :
138138 return int (match .group (1 ), 16 )
139139 # Fängt auch den Fall 'ccreg 00:' (default-Antwort) oder andere unerwartete Antworten ab
@@ -264,7 +264,7 @@ async def read_cc1101_register(self, register_address: int, timeout: float = 2.0
264264 """Read CC1101 register (C<reg>)"""
265265 hex_addr = f"{ register_address :02X} "
266266 # Response-Pattern: ccreg 00: oder Cxx = yy (aus 00_SIGNALduino.pm, Zeile 87)
267- return await self ._send_command (command = f"C{ hex_addr } " , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C[a-f0-9]{2}\s=\s[a-f0-9]+|ccreg 00:' , re .IGNORECASE ))
267+ return await self ._send_command (command = f"C{ hex_addr } " , expect_response = True , timeout = timeout , response_pattern = re .compile (r'C[a-f0-9]{2}\s* =\s* [a-f0-9]+|ccreg 00:' , re .IGNORECASE ))
268268
269269 async def _get_frequency_registers (self ) -> int :
270270 """Liest die CC1101 Frequenzregister (FREQ2, FREQ1, FREQ0) und kombiniert sie zu einem 24-Bit-Wert (F_REG)."""
0 commit comments