2020-05-11 05:01:00 +02:00
|
|
|
"""Constants for the Tuya integration."""
|
2021-10-17 19:24:49 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from dataclasses import dataclass, field
|
2021-10-12 19:36:14 +02:00
|
|
|
from enum import Enum
|
2021-10-17 19:24:49 +02:00
|
|
|
from typing import Callable
|
2020-05-11 05:01:00 +02:00
|
|
|
|
2021-10-12 14:33:19 +02:00
|
|
|
from tuya_iot import TuyaCloudOpenAPIEndpoint
|
|
|
|
|
2021-10-17 19:24:49 +02:00
|
|
|
from homeassistant.const import (
|
|
|
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
|
|
|
CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
|
|
|
|
CONCENTRATION_PARTS_PER_BILLION,
|
|
|
|
CONCENTRATION_PARTS_PER_MILLION,
|
|
|
|
DEVICE_CLASS_AQI,
|
|
|
|
DEVICE_CLASS_BATTERY,
|
|
|
|
DEVICE_CLASS_CO,
|
|
|
|
DEVICE_CLASS_CO2,
|
|
|
|
DEVICE_CLASS_CURRENT,
|
|
|
|
DEVICE_CLASS_DATE,
|
|
|
|
DEVICE_CLASS_ENERGY,
|
|
|
|
DEVICE_CLASS_GAS,
|
|
|
|
DEVICE_CLASS_HUMIDITY,
|
|
|
|
DEVICE_CLASS_ILLUMINANCE,
|
|
|
|
DEVICE_CLASS_MONETARY,
|
|
|
|
DEVICE_CLASS_NITROGEN_DIOXIDE,
|
|
|
|
DEVICE_CLASS_NITROGEN_MONOXIDE,
|
|
|
|
DEVICE_CLASS_NITROUS_OXIDE,
|
|
|
|
DEVICE_CLASS_OZONE,
|
|
|
|
DEVICE_CLASS_PM1,
|
|
|
|
DEVICE_CLASS_PM10,
|
|
|
|
DEVICE_CLASS_PM25,
|
|
|
|
DEVICE_CLASS_POWER,
|
|
|
|
DEVICE_CLASS_POWER_FACTOR,
|
|
|
|
DEVICE_CLASS_PRESSURE,
|
|
|
|
DEVICE_CLASS_SIGNAL_STRENGTH,
|
|
|
|
DEVICE_CLASS_SULPHUR_DIOXIDE,
|
|
|
|
DEVICE_CLASS_TEMPERATURE,
|
|
|
|
DEVICE_CLASS_TIMESTAMP,
|
|
|
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
|
|
|
DEVICE_CLASS_VOLTAGE,
|
|
|
|
ELECTRIC_CURRENT_AMPERE,
|
|
|
|
ELECTRIC_CURRENT_MILLIAMPERE,
|
|
|
|
ELECTRIC_POTENTIAL_MILLIVOLT,
|
|
|
|
ELECTRIC_POTENTIAL_VOLT,
|
|
|
|
ENERGY_KILO_WATT_HOUR,
|
|
|
|
ENERGY_WATT_HOUR,
|
|
|
|
LIGHT_LUX,
|
|
|
|
PERCENTAGE,
|
|
|
|
POWER_KILO_WATT,
|
|
|
|
POWER_WATT,
|
|
|
|
PRESSURE_BAR,
|
|
|
|
PRESSURE_HPA,
|
|
|
|
PRESSURE_INHG,
|
|
|
|
PRESSURE_MBAR,
|
|
|
|
PRESSURE_PA,
|
|
|
|
PRESSURE_PSI,
|
|
|
|
SIGNAL_STRENGTH_DECIBELS,
|
|
|
|
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
|
|
|
TEMP_CELSIUS,
|
|
|
|
TEMP_FAHRENHEIT,
|
|
|
|
VOLUME_CUBIC_FEET,
|
|
|
|
VOLUME_CUBIC_METERS,
|
|
|
|
)
|
|
|
|
|
2020-05-11 05:01:00 +02:00
|
|
|
DOMAIN = "tuya"
|
|
|
|
|
2021-10-05 19:21:55 +02:00
|
|
|
CONF_AUTH_TYPE = "auth_type"
|
2021-09-30 12:02:56 +02:00
|
|
|
CONF_PROJECT_TYPE = "tuya_project_type"
|
|
|
|
CONF_ENDPOINT = "endpoint"
|
|
|
|
CONF_ACCESS_ID = "access_id"
|
|
|
|
CONF_ACCESS_SECRET = "access_secret"
|
|
|
|
CONF_USERNAME = "username"
|
|
|
|
CONF_PASSWORD = "password"
|
|
|
|
CONF_COUNTRY_CODE = "country_code"
|
|
|
|
CONF_APP_TYPE = "tuya_app_type"
|
2020-10-28 02:26:18 +01:00
|
|
|
|
2021-10-20 23:19:42 +02:00
|
|
|
DEVICE_CLASS_TUYA_LED_TYPE = "tuya__led_type"
|
2021-10-20 19:08:43 +02:00
|
|
|
DEVICE_CLASS_TUYA_LIGHT_MODE = "tuya__light_mode"
|
2021-10-20 23:19:42 +02:00
|
|
|
DEVICE_CLASS_TUYA_RELAY_STATUS = "tuya__relay_status"
|
2021-10-20 19:08:43 +02:00
|
|
|
|
2021-10-12 16:49:46 +02:00
|
|
|
TUYA_DISCOVERY_NEW = "tuya_discovery_new"
|
|
|
|
TUYA_HA_SIGNAL_UPDATE_ENTITY = "tuya_entry_update"
|
2021-09-30 12:02:56 +02:00
|
|
|
|
2021-10-04 17:27:24 +02:00
|
|
|
TUYA_RESPONSE_CODE = "code"
|
|
|
|
TUYA_RESPONSE_RESULT = "result"
|
|
|
|
TUYA_RESPONSE_MSG = "msg"
|
|
|
|
TUYA_RESPONSE_SUCCESS = "success"
|
2021-10-15 00:46:06 +02:00
|
|
|
TUYA_RESPONSE_PLATFORM_URL = "platform_url"
|
2020-05-11 05:01:00 +02:00
|
|
|
|
2021-10-04 17:27:24 +02:00
|
|
|
TUYA_SMART_APP = "tuyaSmart"
|
|
|
|
SMARTLIFE_APP = "smartlife"
|
2021-09-30 12:02:56 +02:00
|
|
|
|
2021-10-14 21:04:02 +02:00
|
|
|
PLATFORMS = [
|
|
|
|
"binary_sensor",
|
2021-10-16 23:57:30 +02:00
|
|
|
"camera",
|
2021-10-14 21:04:02 +02:00
|
|
|
"climate",
|
2021-10-19 19:36:15 +02:00
|
|
|
"cover",
|
2021-10-14 21:04:02 +02:00
|
|
|
"fan",
|
2021-10-19 12:10:05 +02:00
|
|
|
"humidifier",
|
2021-10-14 21:04:02 +02:00
|
|
|
"light",
|
2021-10-14 22:15:41 +02:00
|
|
|
"number",
|
2021-10-14 21:04:02 +02:00
|
|
|
"scene",
|
|
|
|
"select",
|
|
|
|
"sensor",
|
2021-10-15 22:28:14 +02:00
|
|
|
"siren",
|
2021-10-14 21:04:02 +02:00
|
|
|
"switch",
|
2021-10-18 23:30:26 +02:00
|
|
|
"vacuum",
|
2021-10-14 21:04:02 +02:00
|
|
|
]
|
2021-10-05 22:32:48 +02:00
|
|
|
|
|
|
|
|
2021-10-18 20:35:01 +02:00
|
|
|
class WorkMode(str, Enum):
|
|
|
|
"""Work modes."""
|
|
|
|
|
|
|
|
COLOUR = "colour"
|
|
|
|
MUSIC = "music"
|
|
|
|
SCENE = "scene"
|
|
|
|
WHITE = "white"
|
|
|
|
|
|
|
|
|
2021-10-12 19:36:14 +02:00
|
|
|
class DPCode(str, Enum):
|
|
|
|
"""Device Property Codes used by Tuya.
|
|
|
|
|
|
|
|
https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
|
|
|
"""
|
|
|
|
|
2021-10-15 22:28:14 +02:00
|
|
|
ALARM_SWITCH = "alarm_switch" # Alarm switch
|
|
|
|
ALARM_TIME = "alarm_time" # Alarm time
|
|
|
|
ALARM_VOLUME = "alarm_volume" # Alarm volume
|
2021-10-19 19:36:15 +02:00
|
|
|
ANGLE_HORIZONTAL = "angle_horizontal"
|
|
|
|
ANGLE_VERTICAL = "angle_vertical"
|
2021-10-12 19:36:14 +02:00
|
|
|
ANION = "anion" # Ionizer unit
|
2021-10-14 21:04:02 +02:00
|
|
|
BATTERY_PERCENTAGE = "battery_percentage" # Battery percentage
|
|
|
|
BATTERY_STATE = "battery_state" # Battery state
|
2021-10-22 14:18:01 +02:00
|
|
|
BATTERY_VALUE = "battery_value" # Battery value
|
2021-10-18 20:35:01 +02:00
|
|
|
BRIGHT_CONTROLLER = "bright_controller"
|
2021-10-15 23:08:21 +02:00
|
|
|
BRIGHT_STATE = "bright_state" # Brightness status
|
2021-10-12 19:36:14 +02:00
|
|
|
BRIGHT_VALUE = "bright_value" # Brightness
|
2021-10-18 20:35:01 +02:00
|
|
|
BRIGHT_VALUE_1 = "bright_value_1"
|
|
|
|
BRIGHT_VALUE_2 = "bright_value_2"
|
2021-10-20 23:19:42 +02:00
|
|
|
BRIGHT_VALUE_3 = "bright_value_3"
|
2021-10-18 20:35:01 +02:00
|
|
|
BRIGHT_VALUE_V2 = "bright_value_v2"
|
2021-10-22 20:28:16 +02:00
|
|
|
BRIGHTNESS_MAX_1 = "brightness_max_1"
|
|
|
|
BRIGHTNESS_MAX_2 = "brightness_max_2"
|
|
|
|
BRIGHTNESS_MAX_3 = "brightness_max_3"
|
|
|
|
BRIGHTNESS_MIN_1 = "brightness_min_1"
|
|
|
|
BRIGHTNESS_MIN_2 = "brightness_min_2"
|
|
|
|
BRIGHTNESS_MIN_3 = "brightness_min_3"
|
2021-10-12 19:36:14 +02:00
|
|
|
C_F = "c_f" # Temperature unit switching
|
2021-10-20 20:49:10 +02:00
|
|
|
CH2O_STATE = "ch2o_state"
|
|
|
|
CH2O_VALUE = "ch2o_value"
|
2021-10-13 21:15:34 +02:00
|
|
|
CHILD_LOCK = "child_lock" # Child lock
|
2021-10-23 18:15:12 +02:00
|
|
|
CO_STATE = "co_state"
|
|
|
|
CO_STATUS = "co_status"
|
|
|
|
CO_VALUE = "co_value"
|
2021-10-20 14:20:24 +02:00
|
|
|
CO2_STATE = "co2_state"
|
2021-10-15 23:08:21 +02:00
|
|
|
CO2_VALUE = "co2_value" # CO2 concentration
|
2021-10-18 20:35:01 +02:00
|
|
|
COLOR_DATA_V2 = "color_data_v2"
|
2021-10-12 19:36:14 +02:00
|
|
|
COLOUR_DATA = "colour_data" # Colored light mode
|
|
|
|
COLOUR_DATA_V2 = "colour_data_v2" # Colored light mode
|
2021-10-14 18:50:51 +02:00
|
|
|
CONCENTRATION_SET = "concentration_set" # Concentration setting
|
2021-10-19 19:36:15 +02:00
|
|
|
CONTROL = "control"
|
|
|
|
CONTROL_2 = "control_2"
|
|
|
|
CONTROL_3 = "control_3"
|
2021-10-14 18:50:51 +02:00
|
|
|
CUP_NUMBER = "cup_number" # NUmber of cups
|
2021-10-14 21:04:02 +02:00
|
|
|
CUR_CURRENT = "cur_current" # Actual current
|
|
|
|
CUR_POWER = "cur_power" # Actual power
|
|
|
|
CUR_VOLTAGE = "cur_voltage" # Actual voltage
|
2021-10-19 12:10:05 +02:00
|
|
|
DEHUMIDITY_SET_VALUE = "dehumidify_set_value"
|
2021-10-20 18:24:34 +02:00
|
|
|
DO_NOT_DISTURB = "do_not_disturb"
|
2021-10-13 22:12:07 +02:00
|
|
|
DOORCONTACT_STATE = "doorcontact_state" # Status of door window sensor
|
2021-10-19 19:36:15 +02:00
|
|
|
DOORCONTACT_STATE_2 = "doorcontact_state_3"
|
|
|
|
DOORCONTACT_STATE_3 = "doorcontact_state_3"
|
2021-10-18 23:30:26 +02:00
|
|
|
ELECTRICITY_LEFT = "electricity_left"
|
2021-10-12 19:36:14 +02:00
|
|
|
FAN_DIRECTION = "fan_direction" # Fan direction
|
|
|
|
FAN_SPEED_ENUM = "fan_speed_enum" # Speed mode
|
|
|
|
FAN_SPEED_PERCENT = "fan_speed_percent" # Stepless speed
|
2021-10-19 23:17:00 +02:00
|
|
|
FAR_DETECTION = "far_detection"
|
2021-10-12 19:36:14 +02:00
|
|
|
FILTER_RESET = "filter_reset" # Filter (cartridge) reset
|
2021-10-23 18:15:52 +02:00
|
|
|
GAS_SENSOR_STATE = "gas_sensor_state"
|
|
|
|
GAS_SENSOR_STATUS = "gas_sensor_status"
|
|
|
|
GAS_SENSOR_VALUE = "gas_sensor_value"
|
2021-10-12 19:36:14 +02:00
|
|
|
HUMIDITY_CURRENT = "humidity_current" # Current humidity
|
|
|
|
HUMIDITY_SET = "humidity_set" # Humidity setting
|
2021-10-15 23:08:21 +02:00
|
|
|
HUMIDITY_VALUE = "humidity_value" # Humidity
|
2021-10-20 23:19:42 +02:00
|
|
|
LED_TYPE_1 = "led_type_1"
|
|
|
|
LED_TYPE_2 = "led_type_2"
|
|
|
|
LED_TYPE_3 = "led_type_3"
|
2021-10-12 19:36:14 +02:00
|
|
|
LIGHT = "light" # Light
|
2021-10-20 19:08:43 +02:00
|
|
|
LIGHT_MODE = "light_mode"
|
2021-10-12 19:36:14 +02:00
|
|
|
LOCK = "lock" # Lock / Child lock
|
2021-10-14 18:50:51 +02:00
|
|
|
MATERIAL = "material" # Material
|
2021-10-12 19:36:14 +02:00
|
|
|
MODE = "mode" # Working mode / Mode
|
2021-10-16 23:57:30 +02:00
|
|
|
MOTION_SWITCH = "motion_switch" # Motion switch
|
2021-10-15 22:28:14 +02:00
|
|
|
MUFFLING = "muffling" # Muffling
|
2021-10-19 23:17:00 +02:00
|
|
|
NEAR_DETECTION = "near_detection"
|
2021-10-18 23:30:26 +02:00
|
|
|
PAUSE = "pause"
|
2021-10-19 19:36:15 +02:00
|
|
|
PERCENT_CONTROL = "percent_control"
|
|
|
|
PERCENT_CONTROL_2 = "percent_control_2"
|
|
|
|
PERCENT_CONTROL_3 = "percent_control_3"
|
|
|
|
PERCENT_STATE = "percent_state"
|
|
|
|
PERCENT_STATE_2 = "percent_state_2"
|
|
|
|
PERCENT_STATE_3 = "percent_state_3"
|
2021-10-15 23:08:21 +02:00
|
|
|
PIR = "pir" # Motion sensor
|
2021-10-20 20:49:10 +02:00
|
|
|
PM25_VALUE = "pm25_value"
|
2021-10-14 22:15:41 +02:00
|
|
|
POWDER_SET = "powder_set" # Powder
|
2021-10-18 23:30:26 +02:00
|
|
|
POWER_GO = "power_go"
|
2021-10-19 23:17:00 +02:00
|
|
|
PRESENCE_STATE = "presence_state"
|
2021-10-12 19:36:14 +02:00
|
|
|
PUMP_RESET = "pump_reset" # Water pump reset
|
2021-10-16 23:57:30 +02:00
|
|
|
RECORD_SWITCH = "record_switch" # Recording switch
|
2021-10-20 19:08:43 +02:00
|
|
|
RELAY_STATUS = "relay_status"
|
2021-10-18 23:30:26 +02:00
|
|
|
SEEK = "seek"
|
2021-10-17 20:56:15 +02:00
|
|
|
SENSITIVITY = "sensitivity" # Sensitivity
|
2021-10-13 20:29:11 +02:00
|
|
|
SHAKE = "shake" # Oscillating
|
2021-10-18 20:35:01 +02:00
|
|
|
SHOCK_STATE = "shock_state" # Vibration status
|
2021-10-19 19:36:15 +02:00
|
|
|
SITUATION_SET = "situation_set"
|
2021-10-23 18:15:12 +02:00
|
|
|
SMOKE_SENSOR_STATE = "smoke_sensor_state"
|
|
|
|
SMOKE_SENSOR_STATUS = "smoke_sensor_status"
|
|
|
|
SMOKE_SENSOR_VALUE = "smoke_sensor_value"
|
2021-10-15 21:32:12 +02:00
|
|
|
SOS = "sos" # Emergency State
|
|
|
|
SOS_STATE = "sos_state" # Emergency mode
|
2021-10-12 19:36:14 +02:00
|
|
|
SPEED = "speed" # Speed level
|
|
|
|
START = "start" # Start
|
2021-10-18 23:30:26 +02:00
|
|
|
STATUS = "status"
|
|
|
|
SUCTION = "suction"
|
2021-10-13 20:29:11 +02:00
|
|
|
SWING = "swing" # Swing mode
|
2021-10-12 19:36:14 +02:00
|
|
|
SWITCH = "switch" # Switch
|
2021-10-13 21:15:34 +02:00
|
|
|
SWITCH_1 = "switch_1" # Switch 1
|
|
|
|
SWITCH_2 = "switch_2" # Switch 2
|
|
|
|
SWITCH_3 = "switch_3" # Switch 3
|
|
|
|
SWITCH_4 = "switch_4" # Switch 4
|
|
|
|
SWITCH_5 = "switch_5" # Switch 5
|
|
|
|
SWITCH_6 = "switch_6" # Switch 6
|
|
|
|
SWITCH_BACKLIGHT = "switch_backlight" # Backlight switch
|
2021-10-18 23:30:26 +02:00
|
|
|
SWITCH_CHARGE = "switch_charge"
|
2021-10-18 20:35:01 +02:00
|
|
|
SWITCH_CONTROLLER = "switch_controller"
|
2021-10-12 19:36:14 +02:00
|
|
|
SWITCH_HORIZONTAL = "switch_horizontal" # Horizontal swing flap switch
|
|
|
|
SWITCH_LED = "switch_led" # Switch
|
2021-10-18 20:35:01 +02:00
|
|
|
SWITCH_LED_1 = "switch_led_1"
|
|
|
|
SWITCH_LED_2 = "switch_led_2"
|
2021-10-20 23:19:42 +02:00
|
|
|
SWITCH_LED_3 = "switch_led_3"
|
2021-10-20 18:24:34 +02:00
|
|
|
SWITCH_NIGHT_LIGHT = "switch_night_light"
|
2021-10-13 21:15:34 +02:00
|
|
|
SWITCH_SPRAY = "switch_spray" # Spraying switch
|
|
|
|
SWITCH_USB1 = "switch_usb1" # USB 1
|
|
|
|
SWITCH_USB2 = "switch_usb2" # USB 2
|
|
|
|
SWITCH_USB3 = "switch_usb3" # USB 3
|
|
|
|
SWITCH_USB4 = "switch_usb4" # USB 4
|
|
|
|
SWITCH_USB5 = "switch_usb5" # USB 5
|
|
|
|
SWITCH_USB6 = "switch_usb6" # USB 6
|
2021-10-12 19:36:14 +02:00
|
|
|
SWITCH_VERTICAL = "switch_vertical" # Vertical swing flap switch
|
2021-10-13 21:15:34 +02:00
|
|
|
SWITCH_VOICE = "switch_voice" # Voice switch
|
2021-10-18 20:35:01 +02:00
|
|
|
TEMP_CONTROLLER = "temp_controller"
|
2021-10-12 19:36:14 +02:00
|
|
|
TEMP_CURRENT = "temp_current" # Current temperature in °C
|
|
|
|
TEMP_CURRENT_F = "temp_current_f" # Current temperature in °F
|
|
|
|
TEMP_SET = "temp_set" # Set the temperature in °C
|
|
|
|
TEMP_SET_F = "temp_set_f" # Set the temperature in °F
|
|
|
|
TEMP_UNIT_CONVERT = "temp_unit_convert" # Temperature unit switching
|
|
|
|
TEMP_VALUE = "temp_value" # Color temperature
|
2021-10-18 20:35:01 +02:00
|
|
|
TEMP_VALUE_V2 = "temp_value_v2"
|
2021-10-13 22:12:07 +02:00
|
|
|
TEMPER_ALARM = "temper_alarm" # Tamper alarm
|
2021-10-12 19:36:14 +02:00
|
|
|
UV = "uv" # UV sterilization
|
2021-10-20 20:49:10 +02:00
|
|
|
VA_HUMIDITY = "va_humidity"
|
|
|
|
VA_TEMPERATURE = "va_temperature"
|
|
|
|
VOC_VALUE = "voc_value"
|
2021-10-13 21:15:34 +02:00
|
|
|
WARM = "warm" # Heat preservation
|
2021-10-14 22:15:41 +02:00
|
|
|
WARM_TIME = "warm_time" # Heat preservation time
|
2021-10-12 19:36:14 +02:00
|
|
|
WATER_RESET = "water_reset" # Resetting of water usage days
|
2021-10-14 22:15:41 +02:00
|
|
|
WATER_SET = "water_set" # Water level
|
2021-10-19 20:09:06 +02:00
|
|
|
WATERSENSOR_STATE = "watersensor_state"
|
2021-10-12 19:36:14 +02:00
|
|
|
WET = "wet" # Humidification
|
|
|
|
WORK_MODE = "work_mode" # Working mode
|
|
|
|
|
|
|
|
|
2021-10-17 19:24:49 +02:00
|
|
|
@dataclass
|
|
|
|
class UnitOfMeasurement:
|
|
|
|
"""Describes a unit of measurement."""
|
|
|
|
|
|
|
|
unit: str
|
|
|
|
device_classes: set[str]
|
|
|
|
|
|
|
|
aliases: set[str] = field(default_factory=set)
|
|
|
|
conversion_unit: str | None = None
|
|
|
|
conversion_fn: Callable[[float], float] | None = None
|
|
|
|
|
|
|
|
|
|
|
|
# A tuple of available units of measurements we can work with.
|
|
|
|
# Tuya's devices aren't consistent in UOM use, thus this provides
|
|
|
|
# a list of aliases for units and possible conversions we can do
|
|
|
|
# to make them compatible with our model.
|
|
|
|
UNITS = (
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit="",
|
|
|
|
aliases={" "},
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_AQI,
|
|
|
|
DEVICE_CLASS_DATE,
|
|
|
|
DEVICE_CLASS_MONETARY,
|
|
|
|
DEVICE_CLASS_TIMESTAMP,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PERCENTAGE,
|
|
|
|
aliases={"pct", "percent"},
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_BATTERY,
|
|
|
|
DEVICE_CLASS_HUMIDITY,
|
|
|
|
DEVICE_CLASS_POWER_FACTOR,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=CONCENTRATION_PARTS_PER_MILLION,
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_CO,
|
|
|
|
DEVICE_CLASS_CO2,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=CONCENTRATION_PARTS_PER_BILLION,
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_CO,
|
|
|
|
DEVICE_CLASS_CO2,
|
|
|
|
},
|
|
|
|
conversion_unit=CONCENTRATION_PARTS_PER_MILLION,
|
|
|
|
conversion_fn=lambda x: x / 1000,
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ELECTRIC_CURRENT_AMPERE,
|
|
|
|
aliases={"a", "ampere"},
|
|
|
|
device_classes={DEVICE_CLASS_CURRENT},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ELECTRIC_CURRENT_MILLIAMPERE,
|
|
|
|
aliases={"ma", "milliampere"},
|
|
|
|
device_classes={DEVICE_CLASS_CURRENT},
|
|
|
|
conversion_unit=ELECTRIC_CURRENT_AMPERE,
|
|
|
|
conversion_fn=lambda x: x / 1000,
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ENERGY_WATT_HOUR,
|
|
|
|
aliases={"wh", "watthour"},
|
|
|
|
device_classes={DEVICE_CLASS_ENERGY},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ENERGY_KILO_WATT_HOUR,
|
|
|
|
aliases={"kwh", "kilowatt-hour"},
|
|
|
|
device_classes={DEVICE_CLASS_ENERGY},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=VOLUME_CUBIC_FEET,
|
|
|
|
aliases={"ft3"},
|
|
|
|
device_classes={DEVICE_CLASS_GAS},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=VOLUME_CUBIC_METERS,
|
|
|
|
aliases={"m3"},
|
|
|
|
device_classes={DEVICE_CLASS_GAS},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=LIGHT_LUX,
|
|
|
|
aliases={"lux"},
|
|
|
|
device_classes={DEVICE_CLASS_ILLUMINANCE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit="lm",
|
|
|
|
aliases={"lum", "lumen"},
|
|
|
|
device_classes={DEVICE_CLASS_ILLUMINANCE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
|
|
|
aliases={"ug/m3", "µg/m3", "ug/m³"},
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_NITROGEN_DIOXIDE,
|
|
|
|
DEVICE_CLASS_NITROGEN_MONOXIDE,
|
|
|
|
DEVICE_CLASS_NITROUS_OXIDE,
|
|
|
|
DEVICE_CLASS_OZONE,
|
|
|
|
DEVICE_CLASS_PM1,
|
|
|
|
DEVICE_CLASS_PM25,
|
|
|
|
DEVICE_CLASS_PM10,
|
|
|
|
DEVICE_CLASS_SULPHUR_DIOXIDE,
|
|
|
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
|
|
|
},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=CONCENTRATION_MILLIGRAMS_PER_CUBIC_METER,
|
|
|
|
aliases={"mg/m3"},
|
|
|
|
device_classes={
|
|
|
|
DEVICE_CLASS_NITROGEN_DIOXIDE,
|
|
|
|
DEVICE_CLASS_NITROGEN_MONOXIDE,
|
|
|
|
DEVICE_CLASS_NITROUS_OXIDE,
|
|
|
|
DEVICE_CLASS_OZONE,
|
|
|
|
DEVICE_CLASS_PM1,
|
|
|
|
DEVICE_CLASS_PM25,
|
|
|
|
DEVICE_CLASS_PM10,
|
|
|
|
DEVICE_CLASS_SULPHUR_DIOXIDE,
|
|
|
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
|
|
|
},
|
|
|
|
conversion_unit=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
|
|
|
conversion_fn=lambda x: x * 1000,
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=POWER_WATT,
|
|
|
|
aliases={"watt"},
|
|
|
|
device_classes={DEVICE_CLASS_POWER},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=POWER_KILO_WATT,
|
|
|
|
aliases={"kilowatt"},
|
|
|
|
device_classes={DEVICE_CLASS_POWER},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_BAR,
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_MBAR,
|
|
|
|
aliases={"millibar"},
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_HPA,
|
|
|
|
aliases={"hpa", "hectopascal"},
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_INHG,
|
|
|
|
aliases={"inhg"},
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_PSI,
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=PRESSURE_PA,
|
|
|
|
device_classes={DEVICE_CLASS_PRESSURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=SIGNAL_STRENGTH_DECIBELS,
|
|
|
|
aliases={"db"},
|
|
|
|
device_classes={DEVICE_CLASS_SIGNAL_STRENGTH},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
|
|
|
aliases={"dbm"},
|
|
|
|
device_classes={DEVICE_CLASS_SIGNAL_STRENGTH},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=TEMP_CELSIUS,
|
|
|
|
aliases={"°c", "c", "celsius"},
|
|
|
|
device_classes={DEVICE_CLASS_TEMPERATURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=TEMP_FAHRENHEIT,
|
|
|
|
aliases={"°f", "f", "fahrenheit"},
|
|
|
|
device_classes={DEVICE_CLASS_TEMPERATURE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ELECTRIC_POTENTIAL_VOLT,
|
|
|
|
aliases={"volt"},
|
|
|
|
device_classes={DEVICE_CLASS_VOLTAGE},
|
|
|
|
),
|
|
|
|
UnitOfMeasurement(
|
|
|
|
unit=ELECTRIC_POTENTIAL_MILLIVOLT,
|
|
|
|
aliases={"mv", "millivolt"},
|
|
|
|
device_classes={DEVICE_CLASS_VOLTAGE},
|
|
|
|
conversion_unit=ELECTRIC_POTENTIAL_VOLT,
|
|
|
|
conversion_fn=lambda x: x / 1000,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
DEVICE_CLASS_UNITS: dict[str, dict[str, UnitOfMeasurement]] = {}
|
|
|
|
for uom in UNITS:
|
|
|
|
for device_class in uom.device_classes:
|
|
|
|
DEVICE_CLASS_UNITS.setdefault(device_class, {})[uom.unit] = uom
|
|
|
|
for unit_alias in uom.aliases:
|
|
|
|
DEVICE_CLASS_UNITS[device_class][unit_alias] = uom
|
|
|
|
|
|
|
|
|
2021-10-05 22:32:48 +02:00
|
|
|
@dataclass
|
|
|
|
class Country:
|
|
|
|
"""Describe a supported country."""
|
|
|
|
|
|
|
|
name: str
|
|
|
|
country_code: str
|
2021-10-12 14:33:19 +02:00
|
|
|
endpoint: str = TuyaCloudOpenAPIEndpoint.AMERICA
|
2021-10-05 22:32:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
# https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb#title-4-China%20Data%20Center
|
|
|
|
TUYA_COUNTRIES = [
|
|
|
|
Country("Afghanistan", "93"),
|
|
|
|
Country("Albania", "355"),
|
|
|
|
Country("Algeria", "213"),
|
|
|
|
Country("American Samoa", "1-684"),
|
|
|
|
Country("Andorra", "376"),
|
|
|
|
Country("Angola", "244"),
|
|
|
|
Country("Anguilla", "1-264"),
|
|
|
|
Country("Antarctica", "672"),
|
|
|
|
Country("Antigua and Barbuda", "1-268"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Argentina", "54", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Armenia", "374"),
|
|
|
|
Country("Aruba", "297"),
|
|
|
|
Country("Australia", "61"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Austria", "43", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Azerbaijan", "994"),
|
|
|
|
Country("Bahamas", "1-242"),
|
|
|
|
Country("Bahrain", "973"),
|
|
|
|
Country("Bangladesh", "880"),
|
|
|
|
Country("Barbados", "1-246"),
|
|
|
|
Country("Belarus", "375"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Belgium", "32", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Belize", "501"),
|
|
|
|
Country("Benin", "229"),
|
|
|
|
Country("Bermuda", "1-441"),
|
|
|
|
Country("Bhutan", "975"),
|
|
|
|
Country("Bolivia", "591"),
|
|
|
|
Country("Bosnia and Herzegovina", "387"),
|
|
|
|
Country("Botswana", "267"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Brazil", "55", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("British Indian Ocean Territory", "246"),
|
|
|
|
Country("British Virgin Islands", "1-284"),
|
|
|
|
Country("Brunei", "673"),
|
|
|
|
Country("Bulgaria", "359"),
|
|
|
|
Country("Burkina Faso", "226"),
|
|
|
|
Country("Burundi", "257"),
|
|
|
|
Country("Cambodia", "855"),
|
|
|
|
Country("Cameroon", "237"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Canada", "1", TuyaCloudOpenAPIEndpoint.AMERICA),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Cape Verde", "238"),
|
|
|
|
Country("Cayman Islands", "1-345"),
|
|
|
|
Country("Central African Republic", "236"),
|
|
|
|
Country("Chad", "235"),
|
|
|
|
Country("Chile", "56"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("China", "86", TuyaCloudOpenAPIEndpoint.CHINA),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Christmas Island", "61"),
|
|
|
|
Country("Cocos Islands", "61"),
|
|
|
|
Country("Colombia", "57"),
|
|
|
|
Country("Comoros", "269"),
|
|
|
|
Country("Cook Islands", "682"),
|
|
|
|
Country("Costa Rica", "506"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Croatia", "385", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Cuba", "53"),
|
|
|
|
Country("Curacao", "599"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Cyprus", "357", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Czech Republic", "420", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Democratic Republic of the Congo", "243"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Denmark", "45", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Djibouti", "253"),
|
|
|
|
Country("Dominica", "1-767"),
|
|
|
|
Country("Dominican Republic", "1-809"),
|
|
|
|
Country("East Timor", "670"),
|
|
|
|
Country("Ecuador", "593"),
|
|
|
|
Country("Egypt", "20"),
|
|
|
|
Country("El Salvador", "503"),
|
|
|
|
Country("Equatorial Guinea", "240"),
|
|
|
|
Country("Eritrea", "291"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Estonia", "372", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Ethiopia", "251"),
|
|
|
|
Country("Falkland Islands", "500"),
|
|
|
|
Country("Faroe Islands", "298"),
|
|
|
|
Country("Fiji", "679"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Finland", "358", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("France", "33", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("French Polynesia", "689"),
|
|
|
|
Country("Gabon", "241"),
|
|
|
|
Country("Gambia", "220"),
|
|
|
|
Country("Georgia", "995"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Germany", "49", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Ghana", "233"),
|
|
|
|
Country("Gibraltar", "350"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Greece", "30", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Greenland", "299"),
|
|
|
|
Country("Grenada", "1-473"),
|
|
|
|
Country("Guam", "1-671"),
|
|
|
|
Country("Guatemala", "502"),
|
|
|
|
Country("Guernsey", "44-1481"),
|
|
|
|
Country("Guinea", "224"),
|
|
|
|
Country("Guinea-Bissau", "245"),
|
|
|
|
Country("Guyana", "592"),
|
|
|
|
Country("Haiti", "509"),
|
|
|
|
Country("Honduras", "504"),
|
|
|
|
Country("Hong Kong", "852"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Hungary", "36", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Iceland", "354", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("India", "91", TuyaCloudOpenAPIEndpoint.INDIA),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Indonesia", "62"),
|
|
|
|
Country("Iran", "98"),
|
|
|
|
Country("Iraq", "964"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Ireland", "353", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Isle of Man", "44-1624"),
|
2021-10-22 11:45:16 +02:00
|
|
|
Country("Israel", "972", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Italy", "39", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Ivory Coast", "225"),
|
|
|
|
Country("Jamaica", "1-876"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Japan", "81", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Jersey", "44-1534"),
|
|
|
|
Country("Jordan", "962"),
|
|
|
|
Country("Kazakhstan", "7"),
|
|
|
|
Country("Kenya", "254"),
|
|
|
|
Country("Kiribati", "686"),
|
|
|
|
Country("Kosovo", "383"),
|
|
|
|
Country("Kuwait", "965"),
|
|
|
|
Country("Kyrgyzstan", "996"),
|
|
|
|
Country("Laos", "856"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Latvia", "371", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Lebanon", "961"),
|
|
|
|
Country("Lesotho", "266"),
|
|
|
|
Country("Liberia", "231"),
|
|
|
|
Country("Libya", "218"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Liechtenstein", "423", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Lithuania", "370", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Luxembourg", "352", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Macau", "853"),
|
|
|
|
Country("Macedonia", "389"),
|
|
|
|
Country("Madagascar", "261"),
|
|
|
|
Country("Malawi", "265"),
|
|
|
|
Country("Malaysia", "60"),
|
|
|
|
Country("Maldives", "960"),
|
|
|
|
Country("Mali", "223"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Malta", "356", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Marshall Islands", "692"),
|
|
|
|
Country("Mauritania", "222"),
|
|
|
|
Country("Mauritius", "230"),
|
|
|
|
Country("Mayotte", "262"),
|
|
|
|
Country("Mexico", "52"),
|
|
|
|
Country("Micronesia", "691"),
|
|
|
|
Country("Moldova", "373"),
|
|
|
|
Country("Monaco", "377"),
|
|
|
|
Country("Mongolia", "976"),
|
|
|
|
Country("Montenegro", "382"),
|
|
|
|
Country("Montserrat", "1-664"),
|
|
|
|
Country("Morocco", "212"),
|
|
|
|
Country("Mozambique", "258"),
|
|
|
|
Country("Myanmar", "95"),
|
|
|
|
Country("Namibia", "264"),
|
|
|
|
Country("Nauru", "674"),
|
|
|
|
Country("Nepal", "977"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Netherlands", "31", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Netherlands Antilles", "599"),
|
|
|
|
Country("New Caledonia", "687"),
|
|
|
|
Country("New Zealand", "64"),
|
|
|
|
Country("Nicaragua", "505"),
|
|
|
|
Country("Niger", "227"),
|
|
|
|
Country("Nigeria", "234"),
|
|
|
|
Country("Niue", "683"),
|
|
|
|
Country("North Korea", "850"),
|
|
|
|
Country("Northern Mariana Islands", "1-670"),
|
|
|
|
Country("Norway", "47"),
|
|
|
|
Country("Oman", "968"),
|
|
|
|
Country("Pakistan", "92"),
|
|
|
|
Country("Palau", "680"),
|
|
|
|
Country("Palestine", "970"),
|
|
|
|
Country("Panama", "507"),
|
|
|
|
Country("Papua New Guinea", "675"),
|
|
|
|
Country("Paraguay", "595"),
|
|
|
|
Country("Peru", "51"),
|
|
|
|
Country("Philippines", "63"),
|
|
|
|
Country("Pitcairn", "64"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Poland", "48", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Portugal", "351", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Puerto Rico", "1-787, 1-939"),
|
|
|
|
Country("Qatar", "974"),
|
|
|
|
Country("Republic of the Congo", "242"),
|
|
|
|
Country("Reunion", "262"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Romania", "40", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Russia", "7", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Rwanda", "250"),
|
|
|
|
Country("Saint Barthelemy", "590"),
|
|
|
|
Country("Saint Helena", "290"),
|
|
|
|
Country("Saint Kitts and Nevis", "1-869"),
|
|
|
|
Country("Saint Lucia", "1-758"),
|
|
|
|
Country("Saint Martin", "590"),
|
|
|
|
Country("Saint Pierre and Miquelon", "508"),
|
|
|
|
Country("Saint Vincent and the Grenadines", "1-784"),
|
|
|
|
Country("Samoa", "685"),
|
|
|
|
Country("San Marino", "378"),
|
|
|
|
Country("Sao Tome and Principe", "239"),
|
|
|
|
Country("Saudi Arabia", "966"),
|
|
|
|
Country("Senegal", "221"),
|
|
|
|
Country("Serbia", "381"),
|
|
|
|
Country("Seychelles", "248"),
|
|
|
|
Country("Sierra Leone", "232"),
|
|
|
|
Country("Singapore", "65"),
|
|
|
|
Country("Sint Maarten", "1-721"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Slovakia", "421", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("Slovenia", "386", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Solomon Islands", "677"),
|
|
|
|
Country("Somalia", "252"),
|
|
|
|
Country("South Africa", "27"),
|
|
|
|
Country("South Korea", "82"),
|
|
|
|
Country("South Sudan", "211"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Spain", "34", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Sri Lanka", "94"),
|
|
|
|
Country("Sudan", "249"),
|
|
|
|
Country("Suriname", "597"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Svalbard and Jan Mayen", "47", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Swaziland", "268"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("Sweden", "46", TuyaCloudOpenAPIEndpoint.EUROPE),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Switzerland", "41"),
|
|
|
|
Country("Syria", "963"),
|
|
|
|
Country("Taiwan", "886"),
|
|
|
|
Country("Tajikistan", "992"),
|
|
|
|
Country("Tanzania", "255"),
|
|
|
|
Country("Thailand", "66"),
|
|
|
|
Country("Togo", "228"),
|
|
|
|
Country("Tokelau", "690"),
|
|
|
|
Country("Tonga", "676"),
|
|
|
|
Country("Trinidad and Tobago", "1-868"),
|
|
|
|
Country("Tunisia", "216"),
|
|
|
|
Country("Turkey", "90"),
|
|
|
|
Country("Turkmenistan", "993"),
|
|
|
|
Country("Turks and Caicos Islands", "1-649"),
|
|
|
|
Country("Tuvalu", "688"),
|
|
|
|
Country("U.S. Virgin Islands", "1-340"),
|
|
|
|
Country("Uganda", "256"),
|
|
|
|
Country("Ukraine", "380"),
|
|
|
|
Country("United Arab Emirates", "971"),
|
2021-10-12 14:33:19 +02:00
|
|
|
Country("United Kingdom", "44", TuyaCloudOpenAPIEndpoint.EUROPE),
|
|
|
|
Country("United States", "1", TuyaCloudOpenAPIEndpoint.AMERICA),
|
2021-10-05 22:32:48 +02:00
|
|
|
Country("Uruguay", "598"),
|
|
|
|
Country("Uzbekistan", "998"),
|
|
|
|
Country("Vanuatu", "678"),
|
|
|
|
Country("Vatican", "379"),
|
|
|
|
Country("Venezuela", "58"),
|
|
|
|
Country("Vietnam", "84"),
|
|
|
|
Country("Wallis and Futuna", "681"),
|
|
|
|
Country("Western Sahara", "212"),
|
|
|
|
Country("Yemen", "967"),
|
|
|
|
Country("Zambia", "260"),
|
|
|
|
Country("Zimbabwe", "263"),
|
|
|
|
]
|