1
0
mirror of https://github.com/mjg59/python-broadlink.git synced 2024-11-22 07:00:12 +01:00

Rename SP4L to SP4 and SP4M to SP4B

This commit is contained in:
Felipe Martins Diel 2020-11-03 23:15:34 -03:00 committed by Matthew Garrett
parent 79f4ad47ff
commit 1d81ebd1d0
2 changed files with 12 additions and 11 deletions

View File

@ -11,7 +11,7 @@ from .exceptions import exception
from .light import lb1 from .light import lb1
from .remote import rm, rm4 from .remote import rm, rm4
from .sensor import a1 from .sensor import a1
from .switch import bg1, mp1, sp1, sp2, sp4l, sp4m from .switch import bg1, mp1, sp1, sp2, sp4, sp4b
SUPPORTED_TYPES = { SUPPORTED_TYPES = {
@ -40,10 +40,11 @@ SUPPORTED_TYPES = {
0x7d0d: (sp2, "SP mini 3", "Broadlink (OEM)"), 0x7d0d: (sp2, "SP mini 3", "Broadlink (OEM)"),
0x9479: (sp2, "SP3S-US", "Broadlink"), 0x9479: (sp2, "SP3S-US", "Broadlink"),
0x947a: (sp2, "SP3S-EU", "Broadlink"), 0x947a: (sp2, "SP3S-EU", "Broadlink"),
0x648b: (sp4m, "SP4M-US", "Broadlink"), 0x756c: (sp4, "SP4M", "Broadlink"),
0x7579: (sp4l, "SP4L-EU", "Broadlink"), 0x7579: (sp4, "SP4L-EU", "Broadlink"),
0x7583: (sp4l, "SP mini 3", "Broadlink"), 0x7583: (sp4, "SP mini 3", "Broadlink"),
0x7d11: (sp4l, "SP mini 3", "Broadlink"), 0x7d11: (sp4, "SP mini 3", "Broadlink"),
0x648b: (sp4b, "SP4M-US", "Broadlink"),
0x2712: (rm, "RM pro/pro+", "Broadlink"), 0x2712: (rm, "RM pro/pro+", "Broadlink"),
0x272a: (rm, "RM pro", "Broadlink"), 0x272a: (rm, "RM pro", "Broadlink"),
0x2737: (rm, "RM mini 3", "Broadlink"), 0x2737: (rm, "RM mini 3", "Broadlink"),

View File

@ -219,13 +219,13 @@ class sp2(device):
return int(hex(payload[0x07] * 256 + payload[0x06])[2:]) + int(hex(payload[0x05])[2:]) / 100.0 return int(hex(payload[0x07] * 256 + payload[0x06])[2:]) + int(hex(payload[0x05])[2:]) / 100.0
class sp4l(device): class sp4(device):
"""Controls a Broadlink SP4L.""" """Controls a Broadlink SP4."""
def __init__(self, *args, **kwargs) -> None: def __init__(self, *args, **kwargs) -> None:
"""Initialize the controller.""" """Initialize the controller."""
device.__init__(self, *args, **kwargs) device.__init__(self, *args, **kwargs)
self.type = "SP4L" self.type = "SP4"
def set_power(self, state: bool) -> None: def set_power(self, state: bool) -> None:
"""Set the power state of the device.""" """Set the power state of the device."""
@ -301,13 +301,13 @@ class sp4l(device):
return state return state
class sp4m(sp4l): class sp4b(sp4):
"""Controls a Broadlink SP4M.""" """Controls a Broadlink SP4 (type B)."""
def __init__(self, *args, **kwargs) -> None: def __init__(self, *args, **kwargs) -> None:
"""Initialize the controller.""" """Initialize the controller."""
device.__init__(self, *args, **kwargs) device.__init__(self, *args, **kwargs)
self.type = "SP4M" self.type = "SP4B"
def _encode(self, flag: int, state: dict) -> bytes: def _encode(self, flag: int, state: dict) -> bytes:
"""Encode a message.""" """Encode a message."""