I’m dipping my toes in the development side of Home Assistant, and want to start by making some tweaks and additions to the modem_callerid
component.
So I found the source and copied it into config/custom_components/sensor
. I then made two small changes. I created a new function called hangup
, and I registered a new service called hangup_phone
:
...snip ...
modem.registercallback(self._incomingcallcallback)
hass.services.register("modem_callerid", "hangup_phone", self.hangup)
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, self._stop_modem)
def hangup(self, state):
"""Hangs up the call"""
self.modem.write("AT+CHUP")
def set_state(self, state):
"""Set the state."""
self._state = state
...snip...
I then reload Home Assistant (either via the config page, or by SSH’ing in and running hassio host reboot
But after that, my HA page just sits there on “Loading Data”, and it never shows me the overview. Looking at the logs, I get this:
2018-04-21 13:05:47 WARNING (MainThread) [homeassistant.setup] Setup of mqtt is taking over 10 seconds.
2018-04-21 13:06:12 ERROR (MainThread) [homeassistant.loader] Unable to find component modem_callerid
2018-04-21 13:06:12 ERROR (MainThread) [homeassistant.setup] Setup failed for modem_callerid: Component not found.
2018-04-21 13:06:24 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-04-21 13:07:07 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform gpmdp is taking over 10 seconds.
2018-04-21 13:07:43 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-04-21 13:07:44 WARNING (MainThread) [homeassistant.components.sensor] Updating hue sensor took longer than the scheduled update interval 0:00:00.500000
2018-04-21 13:07:46 ERROR (SyncWorker_10) [homeassistant.core] Error doing job: Task was destroyed but it is pending!
2018-04-21 13:08:06 ERROR (MainThread) [homeassistant.core] Timer got out of sync. Resetting
2018-04-21 13:08:55 ERROR (MainThread) [homeassistant.loader] Unable to find component modem_callerid
2018-04-21 13:08:55 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/homeassistant/components/websocket_api.py", line 476, in get_services_helper
descriptions = await async_get_all_descriptions(self.hass)
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 152, in async_get_all_descriptions
missing.add(domain_yaml_file(domain))
File "/usr/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 131, in domain_yaml_file
component_path = path.dirname(get_component(domain).__file__)
AttributeError: 'NoneType' object has no attribute '__file__'
…do I need to do something else to override a custom component? Is this not the way to go about it?