Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LRvdLinden authored May 14, 2021
1 parent 705de92 commit 9b9bbc6
Show file tree
Hide file tree
Showing 72 changed files with 93,857 additions and 0 deletions.
76 changes: 76 additions & 0 deletions config/custom_components/dwains_dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import logging

from .load_plugins import load_plugins
from .load_dashboard import load_dashboard
from .const import DOMAIN
from .process_yaml import process_yaml
from .notifications import notifications

from homeassistant.components import frontend

from collections import OrderedDict
from typing import Any, Mapping, MutableMapping, Optional

from homeassistant.helpers import discovery


_LOGGER = logging.getLogger(__name__)

async def async_setup(hass, config):
#_LOGGER.warning("async_setup")

#_LOGGER.warning(config)
#_LOGGER.warning(hass.data[DOMAIN])

# if not config.get(DOMAIN):
# _LOGGER.warning("no config")

hass.data[DOMAIN] = {
"notifications": {},
"commands": {},
'latest_version': ""
}

load_plugins(hass, DOMAIN)

notifications(hass, DOMAIN)

return True

async def async_setup_entry(hass, config_entry):
#_LOGGER.warning("async_setup_entry")

# _LOGGER.error(print(hass.data["hass_customize"]))
# for test in hass.data["hass_customize"].items():
# _LOGGER.warning(test)

process_yaml(hass, config_entry)

load_dashboard(hass, config_entry)

config_entry.add_update_listener(_update_listener)

hass.async_add_job(
hass.config_entries.async_forward_entry_setup(
config_entry, "sensor"
)
)

return True

async def async_remove_entry(hass, config_entry):
_LOGGER.warning("Dwains Dashboard is now uninstalled.")

frontend.async_remove_panel(hass, "dwains-dashboard")

async def _update_listener(hass, config_entry):
_LOGGER.warning('Update_listener called')

process_yaml(hass, config_entry)

hass.bus.async_fire("dwains_dashboard_reload")

#register_modules(hass, config_entry.options)
#load_dashboard(hass, config_entry)

return True
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9b9bbc6

Please sign in to comment.