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

Add switch platform to Comelit SmartHome #102233

Merged
merged 6 commits into from
Oct 18, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add device class only when needed
  • Loading branch information
chemelli74 committed Oct 18, 2023
commit 3fcba797a3f7260b274e1a38f428c2b21be74358
3 changes: 2 additions & 1 deletion homeassistant/components/comelit/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class ComelitSwitchEntity(CoordinatorEntity[ComelitSerialBridge], SwitchEntity):

_attr_has_entity_name = True
_attr_name = None
_attr_device_class = SwitchDeviceClass.OUTLET

def __init__(
self,
Expand All @@ -54,6 +53,8 @@ def __init__(
super().__init__(coordinator)
self._attr_unique_id = f"{config_entry_entry_id}-{device.index}"
self._attr_device_info = self.coordinator.platform_device_info(device)
chemelli74 marked this conversation as resolved.
Show resolved Hide resolved
if device.type == OTHER:
self._attr_device_class = SwitchDeviceClass.OUTLET

async def _switch_set_state(self, state: int) -> None:
"""Set desired light state."""
chemelli74 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading