mirror of
https://github.com/home-assistant/core.git
synced 2026-12-05 05:14:01 -04:00
Define __init__ before other methods in Velux (#187560)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
16207ebc93
commit
a57d3c173b
@@ -88,12 +88,6 @@ class VeluxCover(VeluxEntity, CoverEntity):
|
||||
Velocity.DEFAULT.name.lower(),
|
||||
]
|
||||
|
||||
def _velocity_from_speed(self, speed: str | None) -> Velocity | None:
|
||||
"""Return pyvlx Velocity for the given speed string, or None for default."""
|
||||
if speed in self._attr_supported_speeds:
|
||||
return Velocity[speed.upper()]
|
||||
return None
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, node: OpeningDevice, config_entry_id: str
|
||||
) -> None:
|
||||
@@ -111,6 +105,12 @@ class VeluxCover(VeluxEntity, CoverEntity):
|
||||
case RollerShutter():
|
||||
self._attr_device_class = CoverDeviceClass.SHUTTER
|
||||
|
||||
def _velocity_from_speed(self, speed: str | None) -> Velocity | None:
|
||||
"""Return pyvlx Velocity for the given speed string, or None for default."""
|
||||
if speed in self._attr_supported_speeds:
|
||||
return Velocity[speed.upper()]
|
||||
return None
|
||||
|
||||
@property
|
||||
@override
|
||||
def current_cover_position(self) -> int | None:
|
||||
|
||||
Reference in New Issue
Block a user