Skip to content

Commit

Permalink
Added extra logging to grid charge control
Browse files Browse the repository at this point in the history
  • Loading branch information
trizmark committed May 1, 2024
1 parent d97a2ee commit dafa6dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 0 additions & 4 deletions custom_components/myenergi/select.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Sensor platform for myenergi."""
import logging

import voluptuous as vol
from homeassistant.components.select import SelectEntity
from homeassistant.helpers import entity_platform
Expand All @@ -11,8 +9,6 @@
from .const import DOMAIN
from .entity import MyenergiEntity

_LOGGER: logging.Logger = logging.getLogger(__package__)

LIBBI_MODE_NAMES = {"STOP": "Stopped", "BALANCE": "Normal", "DRAIN": "Export"}

ATTR_BOOST_AMOUNT = "amount"
Expand Down
6 changes: 6 additions & 0 deletions custom_components/myenergi/switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Switch platform for myenergi."""
import logging
import operator

from homeassistant.components.switch import SwitchEntity
Expand All @@ -7,6 +8,8 @@
from .const import DOMAIN
from .entity import MyenergiEntity

_LOGGER: logging.Logger = logging.getLogger(__package__)


async def async_setup_entry(hass, entry, async_add_devices):
"""Setup switch platform."""
Expand Down Expand Up @@ -63,10 +66,13 @@ def icon(self):

async def async_turn_on(self, **kwargs):
"""Turn the entity on."""
_LOGGER.debug("libbi charging from grid is now ON")
_LOGGER.debug(type(self))
await operator.methodcaller(self.meta["update_func"], True)(self.device)
self.async_schedule_update_ha_state()

async def async_turn_off(self, **kwargs):
"""Turn the entity off."""
_LOGGER.debug("libbi charging from grid is now OFF")
await operator.methodcaller(self.meta["update_func"], False)(self.device)
self.async_schedule_update_ha_state()

0 comments on commit dafa6dc

Please sign in to comment.