Skip to content

Commit

Permalink
Add older models to the database (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Dec 7, 2021
1 parent 981e27c commit 52d4f71
Showing 1 changed file with 145 additions and 4 deletions.
149 changes: 145 additions & 4 deletions flux_led/models_db.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""FluxLED Models Database."""

from dataclasses import dataclass
from enum import Enum, auto
from typing import Dict, List, Optional, Set

from .const import (
Expand Down Expand Up @@ -65,6 +66,21 @@ def protocol_for_version_num(self, version_num: int) -> str:
return protocol


class LEDENETChip(Enum):
ESP8266 = auto() # aka ESP8285
BL602 = auto()
S82GESNC = auto()
UNKNOWN = auto()


@dataclass
class LEDENETHardware:
model: str # The model string
chip: LEDENETChip
ir_remote: bool
rf_remote: bool


BASE_MODE_MAP = {
0x01: {COLOR_MODE_DIM},
0x02: {COLOR_MODE_CCT},
Expand Down Expand Up @@ -125,6 +141,125 @@ def protocol_for_version_num(self, version_num: int) -> str:

UNKNOWN_MODEL = "Unknown Model"

# Assumed model version scheme
#
# Example AK001-ZJ2149
#
# 0 1 2 3 4 5
# Z J 2 1 4 9
# | | | | | |
# | | | | | |
# | | | | | Minor Version
# | | | | Major Version
# | | | Chip
# | | Generation
# | Unknown
# Zengge
#
HARDWARE = [
LEDENETHardware(
model="AK001-ZJ100",
chip=LEDENETChip.ESP8266,
ir_remote=False, # verified
rf_remote=False, # verified
),
LEDENETHardware(
model="AK001-ZJ200",
chip=LEDENETChip.ESP8266,
ir_remote=False, # verified
rf_remote=False, # verified
),
LEDENETHardware(
model="AK001-ZJ210", # might also be "AK001-ZJ2100"
chip=LEDENETChip.ESP8266, # verified
ir_remote=False, # verified
rf_remote=False, # verified
),
LEDENETHardware(
model="AK001-ZJ2101",
chip=LEDENETChip.ESP8266,
ir_remote=False,
rf_remote=False,
),
LEDENETHardware(
model="AK001-ZJ2104",
chip=LEDENETChip.ESP8266,
ir_remote=True, # verified - seen on fairy lights
rf_remote=False, # verified
),
LEDENETHardware(
model="AK001-ZJ2134", # seen in smart plugs only?
chip=LEDENETChip.S82GESNC, # couldn't get the device appart
ir_remote=False,
rf_remote=False,
),
LEDENETHardware(
model="AK001-ZJ2145",
chip=LEDENETChip.BL602,
ir_remote=True, # verified - seen on Controller RGBW
rf_remote=False, # verified
),
LEDENETHardware(
model="AK001-ZJ2146", # seen in smart plugs & Controller RGBCW, but RF remote isn't supported on these
chip=LEDENETChip.BL602, # verified
ir_remote=False, # verified
rf_remote=True, # verified
),
LEDENETHardware(
model="AK001-ZJ2147", # seen on Controller RGBW
chip=LEDENETChip.BL602,
ir_remote=False, # verified
rf_remote=True, # verified
),
LEDENETHardware(
model="AK001-ZJ2148", # seen on older Addressable v3
chip=LEDENETChip.BL602,
ir_remote=False, # verified
rf_remote=True, # verified
),
LEDENETHardware(
model="AK001-ZJ2149", # seen on newer Addressable v3
chip=LEDENETChip.BL602,
ir_remote=False, # verified
rf_remote=True, # verified
),
LEDENETHardware(
model="HF-A11-ZJ002", # reported older large box controllers (may be original proto)
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
LEDENETHardware(
model="HF-LPB100", # reported on older UFO
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
LEDENETHardware(
model="HF-LPB100-0", # reported on older UFO
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
LEDENETHardware(
model="HF-LPB100-1", # reported on older UFO
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
LEDENETHardware(
model="HF-LPB100-ZJ002", # seen on older UFO
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
LEDENETHardware(
model="HF-LPB100-ZJ200", # seen on RGBW Downlight
chip=LEDENETChip.UNKNOWN,
ir_remote=False,
rf_remote=False, # unverified
),
]

MODELS = [
LEDENETModel(
Expand All @@ -140,7 +275,13 @@ def protocol_for_version_num(self, version_num: int) -> str:
),
LEDENETModel(
model_num=0x04,
models=["AK001-ZJ200"],
models=[
"HF-LPB100",
"HF-LPB100-0",
"HF-LPB100-1",
"HF-LPB100-ZJ002",
"AK001-ZJ200",
],
description="UFO Controller RGBW", # AKA ZJ-WFUF-170F
always_writes_white_and_colors=True, # Formerly rgbwprotocol
protocols=[MinVersionProtocol(0, PROTOCOL_LEDENET_8BYTE)],
Expand All @@ -154,7 +295,7 @@ def protocol_for_version_num(self, version_num: int) -> str:
# "AK001-ZJ2145" == v2
# "AK001-ZJ2147" == v3
# AK001-ZJ2147 has RF remote support
models=["AK001-ZJ2145", "AK001-ZJ2147"],
models=["AK001-ZJ100", "AK001-ZJ200", "AK001-ZJ2145", "AK001-ZJ2147"],
description="Controller RGBW",
always_writes_white_and_colors=False, # Formerly rgbwprotocol
protocols=[MinVersionProtocol(0, PROTOCOL_LEDENET_8BYTE_DIMMABLE_EFFECTS)],
Expand Down Expand Up @@ -342,7 +483,7 @@ def protocol_for_version_num(self, version_num: int) -> str:
),
LEDENETModel(
model_num=0x25,
models=["AK001-ZJ200"],
models=["HF-LPB100-ZJ200", "AK001-ZJ200"],
description="Controller RGB/WW/CW",
always_writes_white_and_colors=False, # Formerly rgbwprotocol
protocols=[MinVersionProtocol(0, PROTOCOL_LEDENET_9BYTE)],
Expand Down Expand Up @@ -413,7 +554,7 @@ def protocol_for_version_num(self, version_num: int) -> str:
),
LEDENETModel(
model_num=0x44,
models=[],
models=["AK001-ZJ200"],
description="Bulb RGBW",
always_writes_white_and_colors=False, # Formerly rgbwprotocol
protocols=[MinVersionProtocol(0, PROTOCOL_LEDENET_8BYTE)],
Expand Down

0 comments on commit 52d4f71

Please sign in to comment.