Skip to content

Commit

Permalink
Merge pull request #69 from jfarmer08/Update
Browse files Browse the repository at this point in the history
Merge into master
  • Loading branch information
jfarmer08 committed May 6, 2022
2 parents d011eb8 + 5f425b1 commit 931ab9c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions custom_components/sengledapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import logging

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from homeassistant.const import CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME
from homeassistant.const import (CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT,
CONF_USERNAME)
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv

from .const import CONF_COUNTRY, CONF_TYPE, DOMAIN
from .sengledapi.sengledapi import SengledApi
Expand Down
6 changes: 3 additions & 3 deletions custom_components/sengledapi/light.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/python3

"""Platform for light integration."""
"""Platform for light Sengled hintegration."""

from datetime import timedelta
import logging
from datetime import timedelta

# Import the device class from the component that you want to support
from homeassistant.components.light import (
Expand All @@ -23,7 +23,7 @@
from .sengledapi.sengledapi import SengledApi

# Add to support quicker update time. Is this to Fast?
SCAN_INTERVAL = timedelta(seconds=30)
SCAN_INTERVAL = timedelta(seconds=10)
ON = "1"
OFF = "0"

Expand Down
9 changes: 7 additions & 2 deletions custom_components/sengledapi/sengledapi/devices/bulbs/bulb.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ async def async_update(self):
+ " updating."
)
if self._just_changed_state:
self._just_changed_state = False
_LOGGER.info(
"SengledApi: Bulb State Change: %s", self._just_changed_state
)
else:
bulbs = []
url = "https://life2.cloud.sengled.com/life2/device/list.json"
Expand Down Expand Up @@ -305,7 +307,10 @@ async def async_update(self):
+ " updating."
)
if self._just_changed_state:
self._just_changed_state = False
# self._just_changed_state = False
_LOGGER.info(
"SengledApi: Bulb State Change: %s", self._just_changed_state
)
else:
url = "https://element.cloud.sengled.com/zigbee/device/getDeviceDetails.json"
payload = {}
Expand Down
11 changes: 5 additions & 6 deletions custom_components/sengledapi/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

"""Platform for switch integration."""
import logging
from .sengledapi.sengledapi import SengledApi
from . import DOMAIN

import voluptuous as vol

import homeassistant.helpers.config_validation as cv
from homeassistant.const import ATTR_ATTRIBUTION

import voluptuous as vol
# Import the device class from the component that you want to support
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import ATTR_ATTRIBUTION

from . import DOMAIN
from .sengledapi.sengledapi import SengledApi

_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = "Data provided by Sengled"
Expand Down

0 comments on commit 931ab9c

Please sign in to comment.