Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cover.py for 2025.01 #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions custom_components/airbnk_mqtt/cover.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Support for Airbnk locks, treated as covers."""
import logging

from homeassistant.components.cover import SUPPORT_CLOSE, SUPPORT_OPEN, CoverEntity
from homeassistant.components.cover import CoverEntity
from homeassistant.components.cover import CoverEntityFeature # Import the new feature constants

from .const import (
DOMAIN as AIRBNK_DOMAIN,
Expand All @@ -24,14 +24,6 @@
}


async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Old way of setting up the platform.

Can only be called when a user accidentally mentions the platform in their
config. But even in that case it would have been ignored.
"""


async def async_setup_entry(hass, entry, async_add_entities):
"""Set up Airbnk covers based on config_entry."""
locks = []
Expand Down Expand Up @@ -64,7 +56,7 @@ def available(self):
@property
def supported_features(self):
"""Flag supported features."""
supported_features = SUPPORT_OPEN | SUPPORT_CLOSE
supported_features = CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE
return supported_features

@property
Expand Down