Skip to content

Commit

Permalink
fix grama
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront committed Nov 23, 2024
1 parent b093854 commit b9784b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 23 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"cSpell.words": [
"aiohttp",
"clientsession",
"econet",
"hass",
"homeassistant",
Expand Down
20 changes: 6 additions & 14 deletions custom_components/econet300/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Econet300 API class class describint methods of getting and setting data."""
"""Econet300 API class describing methods of getting and setting data."""

import asyncio
from http import HTTPStatus
Expand Down Expand Up @@ -38,7 +38,7 @@ def map_param(param_name):


class Limits:
"""Class difining entity value set limits."""
"""Class defining entity value set limits."""

def __init__(self, min_v: int | None, max_v: int | None):
"""Construct the necessary attributes for the Limits object."""
Expand Down Expand Up @@ -67,7 +67,7 @@ class EconetClient:
def __init__(
self, host: str, username: str, password: str, session: ClientSession
) -> None:
"""Initializethe EconetClient."""
"""Initialize the EconetClient."""

proto = ["http://", "https://"]

Expand Down Expand Up @@ -163,15 +163,6 @@ def __init__(self, client: EconetClient, cache: MemCache) -> None:
self._sw_revision = "default-sw-revision"
self._hw_version = "default-hw-version"

_LOGGER.debug("Econet300Api initialized with client: %s", client)
_LOGGER.debug("Econet300Api initialized with cache: %s", cache)
_LOGGER.debug("Econet300Api initialized with uid: %s", self._uid)
_LOGGER.debug("Econet300Api initialized with model_id: %s", self._model_id)
_LOGGER.debug(
"Econet300Api initialized with sw_revision: %s", self._sw_revision
)
_LOGGER.debug("Econet300Api initialized with hw_version: %s", self._hw_version)

@classmethod
async def create(cls, client: EconetClient, cache: MemCache):
"""Create and return initial object."""
Expand Down Expand Up @@ -206,7 +197,7 @@ def hw_ver(self) -> str:
return self._hw_version

async def init(self):
"""Econet300 Api initilization."""
"""Econet300 Api initialization."""
sys_params = await self._client.fetch_sys_params(API_SYS_PARAMS_URI)

if API_SYS_PARAMS_PARAM_UID not in sys_params:
Expand Down Expand Up @@ -319,10 +310,11 @@ async def _fetch_reg_key(self, reg, data_key: str | None = None):
return data[data_key]

async def fetch_sys_params(self) -> dict[str, Any]:
"""Fetch and return the regParam data from ip/econet/sysParams endpoint."""
return await self._client.fetch_sys_params(API_SYS_PARAMS_URI)

async def fetch_reg_params(self) -> dict[str, Any]:
"""Fetch and return the regParam data from ip/econet/regParams endpoint."""
"""Fetch and return the regParams data from ip/econet/regParams endpoint."""
_LOGGER.info("Calling fetch_reg_params method")
regParams = await self._fetch_reg_names(
API_REG_PARAMS_URI, API_REG_PARAMS_PARAM_DATA
Expand Down
11 changes: 6 additions & 5 deletions custom_components/econet300/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
## Map names for params data in API_REG_PARAMS_DATA_URI
API_RM_CURRENT_DATA_PARAMS_URI = "rmCurrentDataParams"

## Mapunits for params data map API_RM_CURRENT_DATA_PARAMS_URI
## Map units for params data map API_RM_CURRENT_DATA_PARAMS_URI
API_RM_PARAMSUNITSNAMES_URI = "rmParamsUnitsNames"

# Boiler staus keys map
Expand Down Expand Up @@ -125,6 +125,7 @@
"tempFeeder",
"tempExternalSensor",
"fuelLevel",
"tempCO",
},
}

Expand Down Expand Up @@ -177,7 +178,7 @@
"117": "thermostat",
"118": "pumpCOWorks",
"1536": "fanWorks",
"1540": "aditionalFeeder",
"1540": "additionalFeeder",
"1541": "pumpFireplaceWorks",
"1542": "pumpCWUWorks",
}
Expand Down Expand Up @@ -294,7 +295,7 @@
"thermostat": BinarySensorDeviceClass.RUNNING,
"pumpCOWorks": BinarySensorDeviceClass.RUNNING,
"fanWorks": BinarySensorDeviceClass.RUNNING,
"aditionalFeeder": BinarySensorDeviceClass.RUNNING,
"additionalFeeder": BinarySensorDeviceClass.RUNNING,
"pumpFireplaceWorks": BinarySensorDeviceClass.RUNNING,
"pumpCWUWorks": BinarySensorDeviceClass.RUNNING,
"mixerPumpWorks": BinarySensorDeviceClass.RUNNING,
Expand Down Expand Up @@ -342,7 +343,7 @@
"quality": "mdi:signal",
"pumpCOWorks": "mdi:pump",
"fanWorks": "mdi:fan",
"aditionalFeeder": "mdi:screw-lag",
"additionalFeeder": "mdi:screw-lag",
"pumpFireplaceWorks": "mdi:pump",
"pumpCWUWorks": "mdi:pump",
"main_server": "mdi:server",
Expand All @@ -358,7 +359,7 @@
ENTITY_ICON_OFF = {
"pumpCOWorks": "mdi:pump-off",
"fanWorks": "mdi:fan-off",
"aditionalFeeder": "mdi:screw-lag",
"additionalFeeder": "mdi:screw-lag",
"pumpFireplaceWorks": "mdi:pump-off",
"pumpCWUWorks": "mdi:pump-off",
}
Expand Down
4 changes: 2 additions & 2 deletions custom_components/econet300/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"fan_works": {
"name": "Fan"
},
"aditional_feeder": {
"name": "Aditional feeder"
"additional_feeder": {
"name": "Additional feeder"
},
"pump_fireplace_works": {
"name": "Boiler Pump"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/econet300/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"fan_works": {
"name": "Fan"
},
"aditional_feeder": {
"name": "Aditional feeder"
"additional_feeder": {
"name": "Additional feeder"
},
"pump_fireplace_works": {
"name": "Boiler Pump"
Expand Down

0 comments on commit b9784b8

Please sign in to comment.