Skip to content

Commit

Permalink
Removed services.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
kgn3400 committed Aug 10, 2024
1 parent 53a6263 commit 17e1bbc
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 23 deletions.
3 changes: 0 additions & 3 deletions custom_components/hiper_drift/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
DOMAIN,
LOGGER,
)
from .services import async_setup_services

PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]

Expand Down Expand Up @@ -65,8 +64,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

await async_setup_services(hass, component_api)

return True


Expand Down
6 changes: 5 additions & 1 deletion custom_components/hiper_drift/component_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

from .const import CONF_CONTENT, CONF_FYN_REGION, CONF_MSG, CONF_SJ_BH_REGION
from .const import CONF_CONTENT, CONF_FYN_REGION, CONF_MSG, CONF_SJ_BH_REGION, DOMAIN


# ------------------------------------------------------------------
Expand Down Expand Up @@ -53,6 +53,10 @@ def __init__(
self.coordinator: DataUpdateCoordinator
self.last_updated: datetime = None

"""Setup the actions for the Hiper integration."""
hass.services.async_register(DOMAIN, "update", self.async_update_service)
hass.services.async_register(DOMAIN, "reset", self.async_reset_service)

# ------------------------------------------------------------------
async def async_reset_service(self, call: ServiceCall) -> None:
"""Hiper service interface."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/hiper_drift/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"services": {
"reset": "mdi:close-circle-outline"
}
}
}
2 changes: 1 addition & 1 deletion custom_components/hiper_drift/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
],
"single_config_entry": true,
"ssdp": [],
"version": "1.0.17",
"version": "1.0.18",
"zeroconf": []
}
15 changes: 0 additions & 15 deletions custom_components/hiper_drift/services.py

This file was deleted.

2 changes: 1 addition & 1 deletion custom_components/hiper_drift/translations/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@
"name": "Nulstil"
}
}
}
}
2 changes: 1 addition & 1 deletion custom_components/hiper_drift/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@
"name": "Reset"
}
}
}
}

0 comments on commit 17e1bbc

Please sign in to comment.