From fb2a8908a0a037f43406a4baafc06b409fbf3c5b Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 12:57:42 +0200 Subject: [PATCH 1/6] update gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index c18dd8d..6d8f07d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ __pycache__/ + +# local dev env + +/config +/run.sh From 439adbb9551c403b16817407ad377d263a5e6f66 Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 12:58:49 +0200 Subject: [PATCH 2/6] add gha action --- .github/workflows/test.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..f9b58e3 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +--- +name: Test + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + name: Valid integration + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Test HACS Action + uses: hacs/action@main + with: + category: integration + - name: Test Home Assistant hassfest + uses: home-assistant/actions/hassfest@master + pre-commit: + name: pre-commit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - uses: pre-commit/action@v3.0.1 From 506ce9b598076578b799bb68cec1e78aa04f55e9 Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 13:00:23 +0200 Subject: [PATCH 3/6] add pre-commit config --- .pre-commit-config.yaml | 47 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8595be1 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,47 @@ +--- +default_install_hook_types: +- pre-commit +- commit-msg +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: check-docstring-first + - id: check-json + - id: pretty-format-json + exclude: .+/translations/.+.json$ + args: [--autofix, --no-sort-keys] + - id: check-added-large-files + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer +- repo: https://github.com/myint/docformatter + rev: v1.5.1 + hooks: + - id: docformatter + args: [--in-place] +- repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 + hooks: + - id: pyupgrade + args: [--py38-plus] +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.9.0 + hooks: + - id: reorder-python-imports + args: [--py38-plus] +- repo: https://github.com/psf/black + rev: 22.12.0 + hooks: + - id: black + language_version: python3 +- repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-use-type-annotations +- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.2 + hooks: + - id: yamlfmt + args: [--mapping, '2', --sequence, '2', --offset, '0'] From 72d157368fc78a5b6f5022dd7ad9f74e78e08aa8 Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 13:07:51 +0200 Subject: [PATCH 4/6] run pre-commit changes --- README.md | 2 +- .../cover_time_based/__init__.py | 30 ++- .../cover_time_based/config_flow.py | 78 ++++--- custom_components/cover_time_based/const.py | 1 - custom_components/cover_time_based/cover.py | 190 +++++++++++------- .../cover_time_based/manifest.json | 4 +- .../cover_time_based/travelcalculator.py | 3 +- 7 files changed, 184 insertions(+), 124 deletions(-) diff --git a/README.md b/README.md index 8196e84..c97d277 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cover Time-based Component -Forked from [@davidramosweb](https://github.com/davidramosweb/home-assistant-custom-components-cover-time-based) @ 2021, +Forked from [@davidramosweb](https://github.com/davidramosweb/home-assistant-custom-components-cover-time-based) @ 2021, this custom component now integrates easily in Home Assistant. Convert your (dummy) `switch` into a `cover`, and allow to control its position. diff --git a/custom_components/cover_time_based/__init__.py b/custom_components/cover_time_based/__init__.py index aaafc01..a7d8761 100644 --- a/custom_components/cover_time_based/__init__.py +++ b/custom_components/cover_time_based/__init__.py @@ -1,23 +1,24 @@ """Component to wrap switch entities in entities of other domains.""" - from __future__ import annotations import logging import voluptuous as vol - +from homeassistant.components.cover import DOMAIN as COVER_DOMAIN from homeassistant.components.homeassistant import exposed_entities from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ENTITY_ID -from homeassistant.core import Event, HomeAssistant, callback -from homeassistant.helpers import device_registry as dr, entity_registry as er +from homeassistant.core import callback +from homeassistant.core import Event +from homeassistant.core import HomeAssistant +from homeassistant.helpers import device_registry as dr +from homeassistant.helpers import entity_registry as er from homeassistant.helpers.event import async_track_entity_registry_updated_event -from homeassistant.components.cover import ( - DOMAIN as COVER_DOMAIN -) - -from .const import CONF_INVERT, CONF_TARGET_DEVICE_CLASS, CONF_ENTITY_UP, CONF_ENTITY_DOWN +from .const import CONF_ENTITY_DOWN +from .const import CONF_ENTITY_UP +from .const import CONF_INVERT +from .const import CONF_TARGET_DEVICE_CLASS _LOGGER = logging.getLogger(__name__) @@ -97,9 +98,7 @@ async def async_registry_updated( device_id = async_add_to_device(hass, entry, entity_id) - await hass.config_entries.async_forward_entry_setups( - entry, (COVER_DOMAIN,) - ) + await hass.config_entries.async_forward_entry_setups(entry, (COVER_DOMAIN,)) return True @@ -110,15 +109,14 @@ async def config_entry_update_listener(hass: HomeAssistant, entry: ConfigEntry) async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" - return await hass.config_entries.async_unload_platforms( - entry, (COVER_DOMAIN,) - ) + return await hass.config_entries.async_unload_platforms(entry, (COVER_DOMAIN,)) async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None: """Unload a config entry. - This will unhide the wrapped entity and restore assistant expose settings. + This will unhide the wrapped entity and restore assistant expose + settings. """ registry = er.async_get(hass) try: diff --git a/custom_components/cover_time_based/config_flow.py b/custom_components/cover_time_based/config_flow.py index b09a6b4..cfd2a69 100644 --- a/custom_components/cover_time_based/config_flow.py +++ b/custom_components/cover_time_based/config_flow.py @@ -1,22 +1,29 @@ """Config flow for Cover Time-based integration.""" - from __future__ import annotations from collections.abc import Mapping from typing import Any import voluptuous as vol - -from homeassistant.const import CONF_ENTITY_ID, CONF_NAME, Platform from homeassistant.components.cover import CoverDeviceClass -from homeassistant.helpers import entity_registry as er, selector +from homeassistant.const import CONF_ENTITY_ID +from homeassistant.const import CONF_NAME +from homeassistant.const import Platform +from homeassistant.helpers import entity_registry as er +from homeassistant.helpers import selector +from homeassistant.helpers.schema_config_entry_flow import SchemaConfigFlowHandler +from homeassistant.helpers.schema_config_entry_flow import SchemaFlowFormStep from homeassistant.helpers.schema_config_entry_flow import ( - SchemaConfigFlowHandler, - SchemaFlowFormStep, wrapped_entity_config_entry_title, ) -from .const import CONF_ENTITY_UP, CONF_ENTITY_DOWN, CONF_INVERT, CONF_TARGET_DEVICE_CLASS, CONF_TIME_OPEN, CONF_TIME_CLOSE, DOMAIN +from .const import CONF_ENTITY_DOWN +from .const import CONF_ENTITY_UP +from .const import CONF_INVERT +from .const import CONF_TARGET_DEVICE_CLASS +from .const import CONF_TIME_CLOSE +from .const import CONF_TIME_OPEN +from .const import DOMAIN CONFIG_FLOW = { "user": SchemaFlowFormStep( @@ -24,17 +31,22 @@ { vol.Required(CONF_NAME): selector.TextSelector(), vol.Required(CONF_ENTITY_UP): selector.EntitySelector( - selector.EntitySelectorConfig(domain=[Platform.SWITCH, Platform.LIGHT]) + selector.EntitySelectorConfig( + domain=[Platform.SWITCH, Platform.LIGHT] + ) ), vol.Required(CONF_ENTITY_DOWN): selector.EntitySelector( - selector.EntitySelectorConfig(domain=[Platform.SWITCH, Platform.LIGHT]) + selector.EntitySelectorConfig( + domain=[Platform.SWITCH, Platform.LIGHT] + ) ), vol.Required(CONF_TIME_OPEN, default=25): selector.NumberSelector( selector.NumberSelectorConfig( - mode=selector.NumberSelectorMode.BOX, min=2, + mode=selector.NumberSelectorMode.BOX, + min=2, max=120, step="any", - unit_of_measurement="sec" + unit_of_measurement="sec", ) ), vol.Optional(CONF_TIME_CLOSE): selector.NumberSelector( @@ -42,7 +54,7 @@ mode=selector.NumberSelectorMode.BOX, max=120, step="any", - unit_of_measurement="sec" + unit_of_measurement="sec", ) ), } @@ -52,24 +64,27 @@ OPTIONS_FLOW = { "init": SchemaFlowFormStep( - vol.Schema({ - vol.Required(CONF_TIME_OPEN): selector.NumberSelector( - selector.NumberSelectorConfig( - mode=selector.NumberSelectorMode.BOX, min=2, - max=120, - step="any", - unit_of_measurement="sec" - ) - ), - vol.Optional(CONF_TIME_CLOSE): selector.NumberSelector( - selector.NumberSelectorConfig( - mode=selector.NumberSelectorMode.BOX, - max=120, - step="any", - unit_of_measurement="sec" - ) - ), - }) + vol.Schema( + { + vol.Required(CONF_TIME_OPEN): selector.NumberSelector( + selector.NumberSelectorConfig( + mode=selector.NumberSelectorMode.BOX, + min=2, + max=120, + step="any", + unit_of_measurement="sec", + ) + ), + vol.Optional(CONF_TIME_CLOSE): selector.NumberSelector( + selector.NumberSelectorConfig( + mode=selector.NumberSelectorMode.BOX, + max=120, + step="any", + unit_of_measurement="sec", + ) + ), + } + ) ), } @@ -84,7 +99,8 @@ class CoverTimeBasedConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN): MINOR_VERSION = 2 def async_config_entry_title(self, options: Mapping[str, Any]) -> str: - """Return config entry title and hide the wrapped entity if registered.""" + """Return config entry title and hide the wrapped entity if + registered.""" # Hide the wrapped entry if registered registry = er.async_get(self.hass) diff --git a/custom_components/cover_time_based/const.py b/custom_components/cover_time_based/const.py index 573b087..9f992a6 100644 --- a/custom_components/cover_time_based/const.py +++ b/custom_components/cover_time_based/const.py @@ -1,5 +1,4 @@ """Constants for the Cover Time-based integration.""" - from typing import Final DOMAIN: Final = "cover_time_based" diff --git a/custom_components/cover_time_based/cover.py b/custom_components/cover_time_based/cover.py index 963ddec..6e3ba04 100644 --- a/custom_components/cover_time_based/cover.py +++ b/custom_components/cover_time_based/cover.py @@ -1,51 +1,54 @@ """Cover support for switch entities.""" - from __future__ import annotations -from typing import Any import logging - from datetime import timedelta +from typing import Any -from homeassistant.components.cover import ( - DOMAIN as COVER_DOMAIN, - CoverEntity, - CoverEntityFeature, - ATTR_CURRENT_POSITION, - ATTR_POSITION, - PLATFORM_SCHEMA, - -) +from homeassistant.components.cover import ATTR_CURRENT_POSITION +from homeassistant.components.cover import ATTR_POSITION +from homeassistant.components.cover import CoverEntity +from homeassistant.components.cover import CoverEntityFeature +from homeassistant.components.cover import DOMAIN as COVER_DOMAIN +from homeassistant.components.cover import PLATFORM_SCHEMA from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.config_entries import ConfigEntry -from homeassistant.helpers.restore_state import RestoreEntity -from homeassistant.const import ( - CONF_NAME, - ATTR_ENTITY_ID, - CONF_ENTITY_ID, - SERVICE_TURN_OFF, - SERVICE_TURN_ON, - STATE_ON, - SERVICE_CLOSE_COVER, - SERVICE_OPEN_COVER, - SERVICE_STOP_COVER, -) -from homeassistant.core import Event, EventStateChangedData, HomeAssistant, callback -from homeassistant.helpers import device_registry as dr, entity_registry as er +from homeassistant.const import ATTR_ENTITY_ID +from homeassistant.const import CONF_ENTITY_ID +from homeassistant.const import CONF_NAME +from homeassistant.const import SERVICE_CLOSE_COVER +from homeassistant.const import SERVICE_OPEN_COVER +from homeassistant.const import SERVICE_STOP_COVER +from homeassistant.const import SERVICE_TURN_OFF +from homeassistant.const import SERVICE_TURN_ON +from homeassistant.const import STATE_ON +from homeassistant.core import callback +from homeassistant.core import Event +from homeassistant.core import EventStateChangedData +from homeassistant.core import HomeAssistant +from homeassistant.helpers import device_registry as dr +from homeassistant.helpers import entity_registry as er from homeassistant.helpers.device_registry import DeviceEntry -from homeassistant.helpers.event import async_track_utc_time_change, async_track_time_interval -from homeassistant.util import slugify from homeassistant.helpers.entity_platform import AddEntitiesCallback +from homeassistant.helpers.event import async_track_time_interval +from homeassistant.helpers.event import async_track_utc_time_change +from homeassistant.helpers.restore_state import RestoreEntity +from homeassistant.util import slugify -from .const import CONF_ENTITY_UP, CONF_ENTITY_DOWN, CONF_TIME_OPEN, CONF_TIME_CLOSE -from .travelcalculator import TravelCalculator, TravelStatus +from .const import CONF_ENTITY_DOWN +from .const import CONF_ENTITY_UP +from .const import CONF_TIME_CLOSE +from .const import CONF_TIME_OPEN +from .travelcalculator import TravelCalculator +from .travelcalculator import TravelStatus _LOGGER = logging.getLogger(__name__) + async def async_get_device_entry_from_entity_id( hass: HomeAssistant, entity_id: str ) -> DeviceEntry: - """ Get DeviceEntry from an entity ID. """ + """Get DeviceEntry from an entity ID.""" ent_reg = er.async_get(hass) entity_entry = ent_reg.async_get(entity_id) @@ -100,8 +103,15 @@ async def async_setup_entry( class CoverTimeBased(CoverEntity, RestoreEntity): - - def __init__(self, unique_id, name, travel_time_down, travel_time_up, open_switch_entity_id, close_switch_entity_id): + def __init__( + self, + unique_id, + name, + travel_time_down, + travel_time_up, + open_switch_entity_id, + close_switch_entity_id, + ): """Initialize the cover.""" if not travel_time_down: travel_time_down = travel_time_up @@ -117,21 +127,21 @@ def __init__(self, unique_id, name, travel_time_down, travel_time_up, open_switc self.tc = TravelCalculator(self._travel_time_down, self._travel_time_up) async def async_added_to_hass(self): - """ Only cover's position matters. """ - """ The rest is calculated from this attribute.""" + """Only cover's position matters.""" + """The rest is calculated from this attribute.""" old_state = await self.async_get_last_state() - _LOGGER.debug('async_added_to_hass :: oldState %s', old_state) + _LOGGER.debug("async_added_to_hass :: oldState %s", old_state) if ( - old_state is not None and - self.tc is not None and - old_state.attributes.get(ATTR_CURRENT_POSITION) is not None): - self.tc.set_position(int( - old_state.attributes.get(ATTR_CURRENT_POSITION))) + old_state is not None + and self.tc is not None + and old_state.attributes.get(ATTR_CURRENT_POSITION) is not None + ): + self.tc.set_position(int(old_state.attributes.get(ATTR_CURRENT_POSITION))) def _handle_my_button(self): - """Handle the MY button press""" + """Handle the MY button press.""" if self.tc.is_traveling(): - _LOGGER.debug('_handle_my_button :: button stops cover') + _LOGGER.debug("_handle_my_button :: button stops cover") self.tc.stop() self.stop_auto_updater() @@ -158,20 +168,23 @@ def current_cover_position(self): @property def is_opening(self): """Return if the cover is opening or not.""" - return self.tc.is_traveling() and \ - self.tc.travel_direction == TravelStatus.DIRECTION_DOWN + return ( + self.tc.is_traveling() + and self.tc.travel_direction == TravelStatus.DIRECTION_DOWN + ) @property def is_closing(self): """Return if the cover is closing or not.""" - return self.tc.is_traveling() and \ - self.tc.travel_direction == TravelStatus.DIRECTION_UP + return ( + self.tc.is_traveling() + and self.tc.travel_direction == TravelStatus.DIRECTION_UP + ) @property def is_closed(self): """Return if the cover is closed.""" - return self.current_cover_position is None or \ - self.current_cover_position <= 10 + return self.current_cover_position is None or self.current_cover_position <= 10 @property def assumed_state(self): @@ -182,35 +195,38 @@ async def async_set_cover_position(self, **kwargs): """Move the cover to a specific position.""" if ATTR_POSITION in kwargs: position = kwargs[ATTR_POSITION] - _LOGGER.debug('async_set_cover_position: %d', position) + _LOGGER.debug("async_set_cover_position: %d", position) await self.set_position(position) async def async_close_cover(self, **kwargs): """Turn the device close.""" - _LOGGER.debug('async_close_cover') + _LOGGER.debug("async_close_cover") await self._async_handle_command(SERVICE_CLOSE_COVER) self.tc.start_travel_up() self.start_auto_updater() async def async_open_cover(self, **kwargs): """Turn the device open.""" - _LOGGER.debug('async_open_cover') + _LOGGER.debug("async_open_cover") await self._async_handle_command(SERVICE_OPEN_COVER) self.tc.start_travel_down() self.start_auto_updater() async def async_stop_cover(self, **kwargs): """Turn the device stop.""" - _LOGGER.debug('async_stop_cover') + _LOGGER.debug("async_stop_cover") await self._async_handle_command(SERVICE_STOP_COVER) self._handle_my_button() async def set_position(self, position): - _LOGGER.debug('set_position') + _LOGGER.debug("set_position") """Move cover to a designated position.""" current_position = self.tc.current_position() - _LOGGER.debug('set_position :: current_position: %d, new_position: %d', - current_position, position) + _LOGGER.debug( + "set_position :: current_position: %d, new_position: %d", + current_position, + position, + ) command = None if position < current_position: command = SERVICE_CLOSE_COVER @@ -220,31 +236,32 @@ async def set_position(self, position): await self._async_handle_command(command) self.start_auto_updater() self.tc.start_travel(position) - _LOGGER.debug('set_position :: command %s', command) + _LOGGER.debug("set_position :: command %s", command) return def start_auto_updater(self): """Start the autoupdater to update HASS while cover is moving.""" - _LOGGER.debug('start_auto_updater') + _LOGGER.debug("start_auto_updater") if self._unsubscribe_auto_updater is None: - _LOGGER.debug('init _unsubscribe_auto_updater') + _LOGGER.debug("init _unsubscribe_auto_updater") interval = timedelta(seconds=0.1) self._unsubscribe_auto_updater = async_track_time_interval( - self.hass, self.auto_updater_hook, interval) + self.hass, self.auto_updater_hook, interval + ) @callback def auto_updater_hook(self, now): """Call for the autoupdater.""" - _LOGGER.debug('auto_updater_hook') + _LOGGER.debug("auto_updater_hook") self.async_schedule_update_ha_state() if self.position_reached(): - _LOGGER.debug('auto_updater_hook :: position_reached') + _LOGGER.debug("auto_updater_hook :: position_reached") self.stop_auto_updater() self.hass.async_create_task(self.auto_stop_if_necessary()) def stop_auto_updater(self): """Stop the autoupdater.""" - _LOGGER.debug('stop_auto_updater') + _LOGGER.debug("stop_auto_updater") if self._unsubscribe_auto_updater is not None: self._unsubscribe_auto_updater() self._unsubscribe_auto_updater = None @@ -256,31 +273,60 @@ def position_reached(self): async def auto_stop_if_necessary(self): """Do auto stop if necessary.""" if self.position_reached(): - _LOGGER.debug('auto_stop_if_necessary :: calling stop command') + _LOGGER.debug("auto_stop_if_necessary :: calling stop command") await self._async_handle_command(SERVICE_STOP_COVER) self.tc.stop() - async def _async_handle_command(self, command, *args): if command == "close_cover": cmd = "DOWN" self._state = False - await self.hass.services.async_call("homeassistant", "turn_off", {"entity_id": self._open_switch_entity_id}, False) - await self.hass.services.async_call("homeassistant", "turn_on", {"entity_id": self._close_switch_entity_id}, False) + await self.hass.services.async_call( + "homeassistant", + "turn_off", + {"entity_id": self._open_switch_entity_id}, + False, + ) + await self.hass.services.async_call( + "homeassistant", + "turn_on", + {"entity_id": self._close_switch_entity_id}, + False, + ) elif command == "open_cover": cmd = "UP" self._state = True - await self.hass.services.async_call("homeassistant", "turn_off", {"entity_id": self._close_switch_entity_id}, False) - await self.hass.services.async_call("homeassistant", "turn_on", {"entity_id": self._open_switch_entity_id}, False) + await self.hass.services.async_call( + "homeassistant", + "turn_off", + {"entity_id": self._close_switch_entity_id}, + False, + ) + await self.hass.services.async_call( + "homeassistant", + "turn_on", + {"entity_id": self._open_switch_entity_id}, + False, + ) elif command == "stop_cover": cmd = "STOP" self._state = True - await self.hass.services.async_call("homeassistant", "turn_off", {"entity_id": self._close_switch_entity_id}, False) - await self.hass.services.async_call("homeassistant", "turn_off", {"entity_id": self._open_switch_entity_id}, False) + await self.hass.services.async_call( + "homeassistant", + "turn_off", + {"entity_id": self._close_switch_entity_id}, + False, + ) + await self.hass.services.async_call( + "homeassistant", + "turn_off", + {"entity_id": self._open_switch_entity_id}, + False, + ) - _LOGGER.debug('_async_handle_command :: %s', cmd) + _LOGGER.debug("_async_handle_command :: %s", cmd) # Update state of entity self.async_write_ha_state() diff --git a/custom_components/cover_time_based/manifest.json b/custom_components/cover_time_based/manifest.json index 07d1ca3..f0523f5 100644 --- a/custom_components/cover_time_based/manifest.json +++ b/custom_components/cover_time_based/manifest.json @@ -1,7 +1,9 @@ { "domain": "cover_time_based", "name": "Switch to Time-based Cover", - "codeowners": ["@duhow"], + "codeowners": [ + "@duhow" + ], "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/cover_time_based", "integration_type": "helper", diff --git a/custom_components/cover_time_based/travelcalculator.py b/custom_components/cover_time_based/travelcalculator.py index 901945f..71ca7c9 100644 --- a/custom_components/cover_time_based/travelcalculator.py +++ b/custom_components/cover_time_based/travelcalculator.py @@ -12,11 +12,10 @@ * At time 20 TravelCalculator will return position 70 (final position not reached). * At time 30 TravelCalculator will return position 60 (final position reached). """ - from __future__ import annotations -from enum import Enum import time +from enum import Enum class TravelStatus(Enum): From 7a0bc5f0312ebe390fc86f770847b7ccc210ddfc Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 13:09:37 +0200 Subject: [PATCH 5/6] update manifest to add issues --- custom_components/cover_time_based/manifest.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/cover_time_based/manifest.json b/custom_components/cover_time_based/manifest.json index f0523f5..eb97c91 100644 --- a/custom_components/cover_time_based/manifest.json +++ b/custom_components/cover_time_based/manifest.json @@ -5,8 +5,9 @@ "@duhow" ], "config_flow": true, - "documentation": "https://www.home-assistant.io/integrations/cover_time_based", + "documentation": "https://github.com/duhow/hass-cover-time-based/tree/main", + "issue_tracker": "https://github.com/duhow/hass-cover-time-based/issues", "integration_type": "helper", "iot_class": "calculated", - "version": "0.0.2" + "version": "0.0.3" } From 2c6a9cb72039d423b9da4343d5ac85dad78e266c Mon Sep 17 00:00:00 2001 From: duhow Date: Fri, 28 Jun 2024 13:13:41 +0200 Subject: [PATCH 6/6] sort alphabetical for hassfest test --- custom_components/cover_time_based/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/cover_time_based/manifest.json b/custom_components/cover_time_based/manifest.json index eb97c91..99ed808 100644 --- a/custom_components/cover_time_based/manifest.json +++ b/custom_components/cover_time_based/manifest.json @@ -6,8 +6,8 @@ ], "config_flow": true, "documentation": "https://github.com/duhow/hass-cover-time-based/tree/main", - "issue_tracker": "https://github.com/duhow/hass-cover-time-based/issues", "integration_type": "helper", "iot_class": "calculated", + "issue_tracker": "https://github.com/duhow/hass-cover-time-based/issues", "version": "0.0.3" }