Skip to content

Commit cc77f0d

Browse files
style
1 parent 62cd84c commit cc77f0d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

switchbot/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Library to handle connection with Switchbot"""
22

3+
import binascii
34
import logging
45

56
import bluepy
@@ -33,17 +34,10 @@ def _sendpacket(self, key, retry=2) -> bool:
3334
self._sendpacket(key, retry-1)
3435
return True
3536

36-
def update(self) -> None:
37-
"""Synchronize state with switch."""
38-
try:
39-
return self._device.readCharacteristic(HANDLE) == ON_KEY
40-
except bluepy.btle.BTLEException:
41-
self._connect()
42-
43-
def turn_on(self, **kwargs) -> None:
37+
def turn_on(self) -> None:
4438
"""Turn device on."""
4539
return self._sendpacket(ON_KEY)
4640

47-
def turn_off(self, **kwargs) -> None:
41+
def turn_off(self) -> None:
4842
"""Turn device off."""
4943
return self._sendpacket(OFF_KEY)

0 commit comments

Comments
 (0)