milo526 / homebridge-tuya-web

Hoobs and Homebridge plugin for Tuya devices using Home Assistant Tuya Web Api
MIT License
217 stars 93 forks source link

Invalid area code #565

Closed americobarros closed 9 months ago

americobarros commented 9 months ago

The area code matcher may not be working properly. I have updated to 1.1.4 and I am using area code 1, and I keep getting "Invalid area code AZ, must be one of AY, EU, US". Downgrading to 1.1.3 make it work.

Steps To Reproduce

  1. Set area code to "1"
  2. Retry auth
  3. See console

    Homebridge Config

       "name": "TuyaWebPlatform",
                "options": {
                    "username": "------",
                    "password": "--------",
                    "countryCode": 1,
                    "platform": "tuya"
                },
                "defaults": [
                    {
                        "device_type": "form"
                    }
                ],
                "scenes": false,
                "_bridge": {
                    "username": "-------",
                    "port": 34138
                },
                "platform": "TuyaWebPlatform"
    

    Device Config

    { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaus.com/smart/icon/bay1588900714943KlYF/1589188786cafbef5f7af.jpg', 'id': 'ebb335a847tk', 'name': 'Living Room Fan'}, { 'data': { 'brightness': '1000', 'color_mode': 'white', 'color_temp': 11588, 'online': False, 'state': 'true'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaus.com/smart/icon/ay1545812972898u8wAi/158504523520e541bb089.jpg', 'id': '238cfd10', 'name': 'Kitchen White 2'}, { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaus.com/smart/icon/bay1588900714943KlYF/1589188786cafbef5f7af.jpg', 'id': 'eb8af2b9deb26aiw', 'name': 'Bed Fan'}, { 'data': { 'brightness': '1000', 'color_mode': 'white', 'color_temp': 11588, 'online': False, 'state': 'true'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png', 'id': 'eb8b18028eddqlye', 'name': 'Colour Kitchen 2'}, { 'data': { 'brightness': '1000', 'color_mode': 'white', 'color_temp': 11588, 'online': False, 'state': 'true'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaus.com/smart/solution/143006/37e69c2be34b7642_cover.png', 'id': 'ebfac0dc83360e16a9p6gi', 'name': 'Colour Kitchen'}, { 'data': { 'brightness': '1000', 'color_mode': 'white', 'color_temp': 11588, 'online': False, 'state': 'true'}, 'dev_type': 'light', 'ha_type': 'light', 'icon': 'https://images.tuyaus.com/smart/icon/ay1545812972898u8wAi/158504523520e541bb089.jpg', 'id': '2380821428f', 'name': 'Kitchen White'}, { 'data': {}, 'dev_type': 'scene', 'ha_type': 'scene', 'id': 'mA8BUxY209tTPySp', 'name': 'If WiFi Temperature & Humidity ' 'Sensor Temperature : <68.0℉'}, { 'data': {}, 'dev_type': 'scene', 'ha_type': 'scene', 'id': 'O1dAYpRaq', 'name': 'Temp & Humidity >72.0℉ or >55%'}, { 'data': {}, 'dev_type': 'scene', 'ha_type': 'scene', 'id': 'BQ3wb5GuN1pX38Nf', 'name': 'If Washing Machine Leak Sensor ' 'Flooding Detection State : ' 'Flooding Alarm'}, { 'data': {}, 'dev_type': 'scene', 'ha_type': 'scene', 'id': '9qT8pafURyAT', 'name': 'Water Leak'}, { 'data': {}, 'dev_type': 'scene', 'ha_type': 'scene', 'id': '1HTk5oDX', 'name': 'Kitchen Lights Changing'}], 'scenes': []}}

    Additional Context

milo526 commented 9 months ago

Thank you for notifying me of this problem;

This should be fixed in v1.1.5 (9e0ed9c) which I just released; could you please verify?

(It's getting late in my timezone, so I will probably take some time to respond)

americobarros commented 9 months ago

Seems to be working well!