mirror of
https://github.com/home-assistant/core.git
synced 2026-04-29 10:23:46 +02:00
Removed commented code
This commit is contained in:
@@ -14,13 +14,9 @@ from .const import DOMAIN
|
||||
LOGGER = logging.getLogger(__package__)
|
||||
|
||||
# For your initial PR, limit it to 1 platform.
|
||||
# PLATFORMS: list[Platform] = [Platform.COVER]
|
||||
PLATFORMS: list[Platform] = [Platform.BUTTON]
|
||||
|
||||
|
||||
# type FlussConfigEntry = ConfigEntry[FlussData] # noqa: F821
|
||||
|
||||
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Set up Fluss+ from a config entry."""
|
||||
|
||||
|
||||
@@ -44,29 +44,6 @@ class FlussApiClient:
|
||||
headers={"Authorization": self._api_key},
|
||||
)
|
||||
|
||||
# Cover functionality
|
||||
# async def async_open_cover(self, deviceId: str) -> any:
|
||||
# """Open the cover."""
|
||||
# return await self._api_wrapper(
|
||||
# method="post",
|
||||
# url=f"https://zgekzokxrl.execute-api.eu-west-1.amazonaws.com/v1/api/device/{deviceId}/trigger",
|
||||
# headers={"Authorization": self._api_key},
|
||||
# )
|
||||
|
||||
# async def async_close_cover(self, deviceId: str) -> any:
|
||||
# """Open the cover."""
|
||||
# return await self._api_wrapper(
|
||||
# method="post",
|
||||
# url=f"https://zgekzokxrl.execute-api.eu-west-1.amazonaws.com/v1/api/device/{deviceId}/trigger",
|
||||
# headers={"Authorization": self._api_key},
|
||||
# data={
|
||||
# "timeStamp": int(
|
||||
# datetime.datetime.now().timestamp() * 1000
|
||||
# ), # Convert to milliseconds
|
||||
# "metaData": {},
|
||||
# },
|
||||
# )
|
||||
|
||||
async def async_trigger_device(self, deviceId: str) -> typing.Any:
|
||||
"""Trigger the device."""
|
||||
timestamp = int(datetime.datetime.now().timestamp() * 1000)
|
||||
|
||||
@@ -19,12 +19,8 @@ async def async_setup_entry(
|
||||
"""Set up the Fluss Devices."""
|
||||
|
||||
api: FlussApiClient = hass.data[DOMAIN][entry.entry_id]
|
||||
# for device in await api.async_get_devices():
|
||||
# LOGGER.warning("INFO %s", device)
|
||||
# # async_add_entities(FlussDevice() for device in )
|
||||
|
||||
devices = await api.async_get_devices()
|
||||
# LOGGER.warning("Devices %s", devices)
|
||||
if isinstance(devices, dict) and "devices" in devices:
|
||||
devices = devices["devices"]
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ class PlaceholderHub:
|
||||
|
||||
async def authenticate(self) -> bool:
|
||||
"""Test if we can authenticate with the host."""
|
||||
# Actual authentication logic should be here.
|
||||
return True
|
||||
|
||||
|
||||
@@ -44,12 +43,6 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str,
|
||||
if not await hub.authenticate():
|
||||
raise InvalidAuth
|
||||
|
||||
# If you cannot connect:
|
||||
# throw CannotConnect
|
||||
# If the authentication is wrong:
|
||||
# InvalidAuth
|
||||
|
||||
# Return info that you want to store in the config entry.
|
||||
return {"title": "Fluss+"}
|
||||
|
||||
|
||||
|
||||
@@ -38,5 +38,3 @@ class FlussEntity(Entity):
|
||||
|
||||
async def async_update(self) -> None:
|
||||
"""Update state, called by HA if there is a poll interval and by the service homeassistant.update_entity."""
|
||||
# _LOGGER.debug("(%s) Updating entity", self.entry.data[])
|
||||
# await self.device.status_query()
|
||||
|
||||
Reference in New Issue
Block a user