generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
356 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Button platform for Gecko.""" | ||
from homeassistant.components.button import ButtonEntity | ||
|
||
from .const import DOMAIN | ||
from .entity import GeckoEntity | ||
from .spa_manager import GeckoSpaManager | ||
|
||
|
||
async def async_setup_entry(hass, entry, async_add_entities): | ||
"""Setup sensor platform.""" | ||
spaman: GeckoSpaManager = hass.data[DOMAIN][entry.entry_id] | ||
if spaman.reconnect_button is not None: | ||
async_add_entities([GeckoReconnectButton(entry, spaman)]) | ||
|
||
|
||
class GeckoButton(GeckoEntity, ButtonEntity): | ||
"""Gecko button class.""" | ||
|
||
pass | ||
|
||
|
||
class GeckoReconnectButton(GeckoButton): | ||
def __init__(self, config_entry, spaman) -> None: | ||
super().__init__(spaman, config_entry, spaman.reconnect_button) | ||
|
||
async def async_press(self) -> None: | ||
await self._automation_entity.async_press() | ||
|
||
@property | ||
def icon(self) -> str | None: | ||
return "mdi:connection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.