Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pyvesync"
version = "3.4.2"
version = "3.4.3"
description = "pyvesync is a library to manage Etekcity Devices, Cosori Air Fryers, and Levoit Air Purifiers run on the VeSync app."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
24 changes: 2 additions & 22 deletions src/pyvesync/devices/vesyncbulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,8 @@ async def get_details(self) -> None:
self.state.connection_status = ConnectionStatus.OFFLINE
return
self.state.brightness = model.brightness
self.state.device_status = model.deviceStatus
self.state.connection_status = model.connectionStatus

@deprecated(
'toggle() is deprecated, use toggle_switch(toggle: bool | None = None) instead'
)
async def toggle(self, status: str) -> bool:
"""Toggle switch of ESL100 bulb."""
status_bool = status != DeviceStatus.ON
return await self.toggle_switch(status_bool)
self.state.device_status = DeviceStatus(model.deviceStatus)
self.state.connection_status = ConnectionStatus(model.connectionStatus)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't match return type anymore.


async def toggle_switch(self, toggle: bool | None = None) -> bool:
if toggle is None:
Expand All @@ -331,18 +323,6 @@ async def toggle_switch(self, toggle: bool | None = None) -> bool:
self.state.device_status = status
return True

@deprecated('Use set_brightness() instead')
async def set_status(self, brightness: int) -> bool:
"""Set brightness of dimmable bulb.

Args:
brightness (int): Brightness of bulb (0-100).

Returns:
bool: True if successful, False otherwise.
"""
return await self.set_brightness(brightness=brightness)

async def set_brightness(self, brightness: int) -> bool:
if not self.supports_brightness:
logger.warning('%s is not dimmable', self.device_name)
Expand Down
Loading