diff --git a/vivintpy/zjs_device_config_db.json b/vivintpy/zjs_device_config_db.json index f54ea1a..cc643df 100644 --- a/vivintpy/zjs_device_config_db.json +++ b/vivintpy/zjs_device_config_db.json @@ -46,7 +46,7 @@ }, "0x0000:0x0004:0x0004": { "description": "USB Controller", - "label": "700 Series", + "label": "700/800 Series", "manufacturer": "Silicon Labs" }, "0x0001:0x4243:0x0000": { @@ -390,7 +390,7 @@ "manufacturer": "HomeSeer Technologies" }, "0x000c:0x0004:0x0001": { - "description": "Z-Wave Multi Sensorr", + "description": "Z-Wave Multi Sensor", "label": "HS-HSM200", "manufacturer": "HomeSeer Technologies" }, @@ -429,6 +429,11 @@ "label": "HS-FC200+", "manufacturer": "HomeSeer Technologies" }, + "0x000c:0x0204:0x0002": { + "description": "Z-Wave Presence Sensor", + "label": "HS-PS100", + "manufacturer": "HomeSeer Technologies" + }, "0x000c:0x4447:0x3031": { "description": "Appliance Module", "label": "HS-PA100+", @@ -814,6 +819,16 @@ "label": "ZW4SF", "manufacturer": "Leviton" }, + "0x001d:0x0041:0x0002": { + "description": "Decora Smart 800 Series Dimmer", + "label": "ZW6HD", + "manufacturer": "Leviton" + }, + "0x001d:0x0042:0x0002": { + "description": "Decora Smart 800 Series Switch", + "label": "ZW15S", + "manufacturer": "Leviton" + }, "0x001d:0x0101:0x0328": { "description": "Scene Capable Plug-In Appliance Module, 300W", "label": "VRP15", @@ -2429,6 +2444,16 @@ "label": "59338 / ZWA4012DV", "manufacturer": "Enbrighten" }, + "0x0063:0x4952:0x3333": { + "description": "In-Wall Paddle Switch, QFSW, 700S", + "label": "58433 / 59344 / ZWA4011", + "manufacturer": "Enbrighten" + }, + "0x0063:0x4952:0x3334": { + "description": "In-Wall Toggle Switch, QFSW, 700S", + "label": "59368 / ZWA4012", + "manufacturer": "UltraPro" + }, "0x0063:0x4952:0x3339": { "description": "In-Wall Outlet, TR, 700S", "label": "58449 / ZWA1003", @@ -5109,6 +5134,11 @@ "label": "YRD210", "manufacturer": "Yale" }, + "0x0109:0x0004:0xffff": { + "description": "Push Button Deadbolt", + "label": "YRD210", + "manufacturer": "Yale" + }, "0x0109:0x1001:0x0101": { "description": "USB Dongle", "label": "ZU1401", @@ -5899,6 +5929,11 @@ "label": "FGR223", "manufacturer": "Fibargroup" }, + "0x010f:0x0304:0x1000": { + "description": "Roller Shutter 4", + "label": "FGR-224", + "manufacturer": "Fibargroup" + }, "0x010f:0x0400:0x0102": { "description": "Relay Switch 1x3kW", "label": "FGS211", @@ -12525,6 +12560,11 @@ "label": "ZEN34", "manufacturer": "Zooz" }, + "0x027a:0x7000:0xf003": { + "description": "Wall Remote", + "label": "ZEN37 800LR", + "manufacturer": "Zooz" + }, "0x027a:0xa000:0xa001": { "description": "Z-Wave Plus S2 ON/OFF Switch", "label": "ZEN26", @@ -14396,6 +14436,11 @@ "label": "ZWA012", "manufacturer": "Aeotec Ltd." }, + "0x0371:0x0202:0x0018": { + "description": "MultiSensor 7", + "label": "ZWA024", + "manufacturer": "Aeotec Ltd." + }, "0x0371:0x0202:0x0029": { "description": "Door/Window Sensor 7", "label": "ZWA011", @@ -15351,5 +15396,5 @@ "label": "BW8120", "manufacturer": "Remotec" }, - "updated_at": "2024-04-06T22:22:20.961929" + "updated_at": "2024-07-08T02:36:24.368049" } \ No newline at end of file diff --git a/vivintpy/zjs_device_config_db.py b/vivintpy/zjs_device_config_db.py index 148c634..ada6a53 100644 --- a/vivintpy/zjs_device_config_db.py +++ b/vivintpy/zjs_device_config_db.py @@ -4,11 +4,13 @@ import json import os +from typing import Final -ZJS_DEVICE_CONFIG_DB_FILE = os.path.join( - os.path.dirname(__file__), "zjs_device_config_db.json" -) -ZJS_DEVICE_DB: dict[str, str | dict[str, str]] = {} +with open( + os.path.join(os.path.dirname(__file__), "zjs_device_config_db.json"), + encoding="utf8", +) as file: + ZJS_DEVICE_DB: Final[dict[str, str | dict[str, str]]] = json.load(file) def get_zwave_device_info( @@ -16,15 +18,6 @@ def get_zwave_device_info( ) -> dict[str, str]: """Lookup the Z-Wave device based on the manufacturer id, product type and product id.""" key = f"0x{manufacturer_id:04x}:0x{product_type:04x}:0x{product_id:04x}" - if isinstance((device_info := _get_zjs_db().get(key)), dict): + if isinstance((device_info := ZJS_DEVICE_DB.get(key)), dict): return device_info return {} - - -def _get_zjs_db() -> dict[str, str | dict[str, str]]: - """Load the Z-Wave JS device config from the saved JSON file.""" - global ZJS_DEVICE_DB # pylint: disable=global-statement - if not ZJS_DEVICE_DB: - with open(ZJS_DEVICE_CONFIG_DB_FILE, encoding="utf-8") as device_file: - ZJS_DEVICE_DB = json.load(device_file) - return ZJS_DEVICE_DB