Skip to content

Commit

Permalink
Move to external API library
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Dec 6, 2024
1 parent 237e846 commit 31f3bf1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 350 deletions.
2 changes: 1 addition & 1 deletion custom_components/ohme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from homeassistant.helpers.entity_registry import RegistryEntry, async_migrate_entries
from .const import *
from .utils import get_option
from .api_client import OhmeApiClient
from ohme import OhmeApiClient
from .coordinator import OhmeChargeSessionsCoordinator, OhmeAccountInfoCoordinator, OhmeAdvancedSettingsCoordinator, OhmeChargeSchedulesCoordinator
from homeassistant.exceptions import ConfigEntryNotReady

Expand Down
344 changes: 0 additions & 344 deletions custom_components/ohme/api_client.py

This file was deleted.

4 changes: 2 additions & 2 deletions custom_components/ohme/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity import DeviceInfo, Entity
from homeassistant.core import callback

class OhmeEntity(Entity):
Expand All @@ -16,7 +16,7 @@ def __init__(self, cooordinator, hass, client):
self._last_updated = None
self._state = None

self._attr_device_info = client.get_device_info()
self._attr_device_info = DeviceInfo(**client.get_device_info())

async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ohme/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import voluptuous as vol
from homeassistant.config_entries import (ConfigFlow, OptionsFlow)
from .const import DOMAIN, CONFIG_VERSION, DEFAULT_INTERVAL_CHARGESESSIONS, DEFAULT_INTERVAL_ACCOUNTINFO, DEFAULT_INTERVAL_ADVANCED, DEFAULT_INTERVAL_SCHEDULES
from .api_client import OhmeApiClient
from ohme import OhmeApiClient


USER_SCHEMA = vol.Schema({
Expand Down
4 changes: 2 additions & 2 deletions custom_components/ohme/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"documentation": "https://github.com/dan-r/HomeAssistant-Ohme",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/dan-r/HomeAssistant-Ohme/issues",
"requirements": [],
"version": "1.1.0"
"requirements": ["ohme==1.0.1"],
"version": "1.1.1"
}

0 comments on commit 31f3bf1

Please sign in to comment.