From 2e946c42afcd14ea467c05834933cbde75315397 Mon Sep 17 00:00:00 2001 From: laraveluser <44818308+laraveluser@users.noreply.github.com> Date: Sun, 31 Mar 2024 01:31:53 +0100 Subject: [PATCH 1/3] AVM: Bugfix get_calllist and get_contact_name_by_phone_number --- avm/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/avm/__init__.py b/avm/__init__.py index 948017750..bbd28b674 100644 --- a/avm/__init__.py +++ b/avm/__init__.py @@ -594,7 +594,7 @@ def set_call_origin(self, phone_name: str): return self.fritz_device.set_call_origin(phone_name) @NoAttributeError - def get_calllist(self): + def get_calllist(self, filter_incoming: str = ''): return self.fritz_device.get_calllist_from_cache() @NoAttributeError @@ -607,7 +607,7 @@ def get_phone_numbers_by_name(self, name: str = '', phonebook_id: int = 0): @NoAttributeError def get_contact_name_by_phone_number(self, phone_number: str = '', phonebook_id: int = 0): - return self.fritz_device.get_phone_numbers_by_name(phone_number, phonebook_id) + return self.fritz_device.get_contact_name_by_phone_number(phone_number, phonebook_id) @NoAttributeError def get_device_log_from_lua(self): @@ -1381,7 +1381,7 @@ def get_contact_name_by_phone_number(self, phone_number: str = '', phonebook_id: # phonebook_url = self.client.InternetGatewayDevice.X_AVM_DE_OnTel.GetPhonebook(NewPhonebookID=phonebook_id)['NewPhonebookURL'] phonebook_url = to_str(self._poll_fritz_device('phonebook_url', phonebook_id, enforce_read=True)) if not phonebook_url: - return '' + return phone_number phonebooks = request_response_to_xml(self._request(phonebook_url, self._timeout, self.verify)) if phonebooks: @@ -1395,7 +1395,7 @@ def get_contact_name_by_phone_number(self, phone_number: str = '', phonebook_id: else: self.logger.error("Phonebook not available on the FritzDevice") - return '' + return phone_number def get_phone_numbers_by_name(self, name: str = '', phonebook_id: int = 0) -> dict: """Get phone number from phone book by contact""" From b028fe64840f9a8deaaf91b7546fb0db049905f1 Mon Sep 17 00:00:00 2001 From: laraveluser <44818308+laraveluser@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:59:30 +0200 Subject: [PATCH 2/3] Update __init__.py compatibility edit --- avm/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/avm/__init__.py b/avm/__init__.py index bbd28b674..2668268f7 100644 --- a/avm/__init__.py +++ b/avm/__init__.py @@ -595,7 +595,10 @@ def set_call_origin(self, phone_name: str): @NoAttributeError def get_calllist(self, filter_incoming: str = ''): - return self.fritz_device.get_calllist_from_cache() + if filter_incoming : + return self.fritz_device.get_calllist(filter_incoming) + else + return self.fritz_device.get_calllist_from_cache() @NoAttributeError def get_phone_name(self, index: int = 1): From bb0f8c420937c62bf49e07763f02aa5d61fe0632 Mon Sep 17 00:00:00 2001 From: laraveluser <44818308+laraveluser@users.noreply.github.com> Date: Mon, 1 Apr 2024 21:35:31 +0200 Subject: [PATCH 3/3] Update __init__.py --- avm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avm/__init__.py b/avm/__init__.py index 2668268f7..976fc607a 100644 --- a/avm/__init__.py +++ b/avm/__init__.py @@ -597,7 +597,7 @@ def set_call_origin(self, phone_name: str): def get_calllist(self, filter_incoming: str = ''): if filter_incoming : return self.fritz_device.get_calllist(filter_incoming) - else + else : return self.fritz_device.get_calllist_from_cache() @NoAttributeError