mawaqit / home-assistant

Mawaqit integration - salat time and nearest mosque - in Home Assistant
60 stars 16 forks source link

Error setting up entry Mawaqit for mawaqit_prayer_times #15

Closed Abdelmounaim18 closed 2 years ago

Abdelmounaim18 commented 2 years ago

Salaam @yac69 @ibrahim-zehhaf-mawaqit

Mawaqit was running just fine since the last time I created an issue. Unfortunately I suddenly got this error overnight, my sensors are now unavailable again. The logs are attached below, looks like it doesn't expect the key "shuruq" in the response.json() and something about an exception.

I hope there is a fix for this issue.

Barak Allahu Fiek

This error was caused by a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/mawaqit_prayer_times/__init__.py:286 
Integration: Mawaqit Prayer Times 
First occurred: 04:30:49 (2 occurrences) 
Last logged: 05:50:10

Error setting up entry Mawaqit for mawaqit_prayer_times
Traceback (most recent call last):
  File "/config/custom_components/mawaqit_prayer_times/__init__.py", line 285, in async_setup
    await self.hass.async_add_executor_job(self.get_new_prayer_times)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mawaqit_prayer_times/__init__.py", line 190, in get_new_prayer_times
    n = text_file.write(str(calc.fetch_prayer_times()))
  File "/usr/local/lib/python3.9/site-packages/mawaqit_times_calculator/pray_times_calculator.py", line 102, in fetch_prayer_times
    'Sunrise': response.json()["shuruq"],
KeyError: 'shuruq'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/mawaqit_prayer_times/__init__.py", line 72, in async_setup_entry
    if not await client.async_setup():
  File "/config/custom_components/mawaqit_prayer_times/__init__.py", line 286, in async_setup
    except (exceptions.InvalidResponseError, ConnError) as err:
NameError: name 'exceptions' is not defined
mouledla commented 2 years ago

I got the same error.

Abdelmounaim18 commented 2 years ago

Any update on this matter? Still not working unfortunately... 😕

mouledla commented 2 years ago

I hope someone will help us soon in sha Allah. Cant live without my adhan XD

ibrahim-zehhaf-mawaqit commented 2 years ago

@yac69 can you help to fix the plugin please

ibrahim-zehhaf-mawaqit commented 2 years ago

duplicate with #11