Skip to content

Commit

Permalink
Fix potential issues with this integratioin and scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
gazoodle committed Feb 17, 2025
1 parent f6bf737 commit b7fd8dc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
# Version History

## v0.1.21
- Prevent various entities (such as reminder dates) from being included in scenes as this would make
reminders a bit pointless. This was belt and braces really since the date platform doesn't support
scene restore, but in doing this, there were other entities that were being used that would have
potentially caused problems.

## v0.1.20
- Support changing date for reminders. A simple button to reset was originally considered, but
Expand Down
3 changes: 2 additions & 1 deletion custom_components/gecko/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import datetime
import logging

from geckolib.automation.button import GeckoButton as GeckoLibButton
from homeassistant.components.button import ButtonEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
Expand All @@ -13,7 +14,6 @@
from .const import VERSION as INTEGRATION_VERSION
from .entity import GeckoEntity, GeckoEntityBase
from .spa_manager import GeckoSpaManager
from geckolib.automation.button import GeckoButton as GeckoLibButton

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -47,6 +47,7 @@ class GeckoKeypadButton(GeckoButton):
def __init__(
self, config_entry: ConfigEntry, spaman: GeckoSpaManager, button: GeckoLibButton
) -> None:
"""Initialize the keypad button."""
super().__init__(spaman, config_entry, button)
self._button: GeckoLibButton = button

Expand Down
2 changes: 2 additions & 0 deletions custom_components/gecko/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from geckolib import GeckoReminderType
from homeassistant.components.date import DateEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

Expand Down Expand Up @@ -69,6 +70,7 @@ def __init__(
)
self._reminder_type = reminder_type
self.spaman.facade.reminders_manager.watch(self._on_change)
self._entity_category = EntityCategory.CONFIG

@property
def native_value(self) -> datetime | None:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gecko/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"iot_class": "local_push",
"issue_tracker": "https://github.com/gazoodle/gecko-home-assistant/issues",
"requirements": [
"geckolib==1.0.4"
"geckolib==1.0.3"
],
"version": "0.1.21"
}
2 changes: 2 additions & 0 deletions custom_components/gecko/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from geckolib import GeckoAutomationFacadeBase
from homeassistant.components.select import SelectEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

Expand Down Expand Up @@ -48,6 +49,7 @@ def __init__(
) -> None:
"""Initialize the select."""
super().__init__(spaman, entry, select)
self._entity_category = EntityCategory.CONFIG
_LOGGER.debug("%r loaded. Options are %s", select, select.states)

@property
Expand Down
13 changes: 11 additions & 2 deletions custom_components/gecko/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

Expand All @@ -22,9 +23,17 @@ async def async_setup_entry(
if spaman.facade is not None:
entities = []
if spaman.facade.eco_mode is not None:
entities.append(GeckoBinarySwitch(spaman, entry, spaman.facade.eco_mode))
entities.append(
GeckoBinarySwitch(
spaman, entry, spaman.facade.eco_mode, EntityCategory.CONFIG
)
)
if spaman.facade.standby is not None:
entities.append(GeckoBinarySwitch(spaman, entry, spaman.facade.standby))
entities.append(
GeckoBinarySwitch(
spaman, entry, spaman.facade.standby, EntityCategory.CONFIG
)
)
async_add_entities(entities)


Expand Down

0 comments on commit b7fd8dc

Please sign in to comment.