Skip to content

Commit

Permalink
Fix generate entity id again
Browse files Browse the repository at this point in the history
  • Loading branch information
forabi committed Jun 9, 2023
1 parent 8bef9e3 commit 23c396e
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 145 deletions.
3 changes: 3 additions & 0 deletions custom_components/tuya_ble/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def __init__(
self._attr_has_entity_name = True
self._attr_device_info = get_device_info(self._device)
self._attr_unique_id = f"{self._device.device_id}-{description.key}"
self.entity_id = generate_entity_id(
"sensor.{}", self._attr_unique_id, hass=hass
)

@property
def available(self) -> bool:
Expand Down
286 changes: 143 additions & 143 deletions custom_components/tuya_ble/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,152 +1,152 @@
{
"config": {
"abort": {
"no_unconfigured_devices": "No unconfigured devices found."
},
"error": {
"device_not_registered": "Device is not registered in Tuya cloud",
"invalid_auth": "Invalid authentication",
"login_error": "Login error ({code}): {msg}"
},
"flow_title": "{name}",
"step": {
"device": {
"data": {
"address": "Tuya BLE device"
"config": {
"abort": {
"no_unconfigured_devices": "No unconfigured devices found."
},
"description": "Select Tuya BLE device to setup. Device must be registered in the cloud using the mobile application. It's better to unbind the device from Tuya Bluetooth gateway, if any."
},
"login": {
"data": {
"access_id": "Tuya IoT Access ID",
"access_secret": "Tuya IoT Access Secret",
"country_code": "Country",
"password": "Password",
"username": "Account"
"error": {
"device_not_registered": "Device is not registered in Tuya cloud",
"invalid_auth": "Invalid authentication",
"login_error": "Login error ({code}): {msg}"
},
"description": "Tuya BLE requires obtaining encryption key from Tuya cloud. Almost all devices only need to access the cloud once during setup.\n\nRefer to documentation of Tuya integration to retrive the cloud credentials https://www.home-assistant.io/integrations/tuya/\n\nEnter your Tuya credentials."
}
}
},
"entity": {
"button": {
"push": {
"name": "Push"
}
},
"number": {
"brightness": {
"name": "Brightness"
},
"carbon_dioxide_alarm_level": {
"name": "Alarm level"
},
"down_position": {
"name": "Down position"
},
"hold_time": {
"name": "Hold time"
},
"reporting_period": {
"name": "Reporting period"
},
"up_position": {
"name": "Up position"
}
},
"select": {
"fingerbot_mode": {
"name": "Mode",
"state": {
"push": "Push",
"switch": "Switch"
"flow_title": "{name}",
"step": {
"device": {
"data": {
"address": "Tuya BLE device"
},
"description": "Select Tuya BLE device to setup. Device must be registered in the cloud using the mobile application. It's better to unbind the device from Tuya Bluetooth gateway, if any."
},
"login": {
"data": {
"access_id": "Tuya IoT Access ID",
"access_secret": "Tuya IoT Access Secret",
"country_code": "Country",
"password": "Password",
"username": "Account"
},
"description": "Tuya BLE requires obtaining encryption key from Tuya cloud. Almost all devices only need to access the cloud once during setup.\n\nRefer to documentation of Tuya integration to retrive the cloud credentials https://www.home-assistant.io/integrations/tuya/\n\nEnter your Tuya credentials."
}
}
},
"temperature_unit": {
"name": "Temperature unit"
}
},
"sensor": {
"battery": {
"name": "Battery"
},
"battery_charging": {
"name": "Battery charging",
"state": {
"charged": "Charged",
"charging": "Charging",
"not_charging": "Not charging"
}
},
"battery_state": {
"name": "Battery state",
"state": {
"high": "High",
"low": "Low",
"normal": "Normal"
}
},
"carbon_dioxide": {
"name": "Carbon dioxide"
},
"carbon_dioxide_alarm": {
"name": "Carbon dioxide level",
"state": {
"alarm": "Alarm",
"normal": "Normal"
"entity": {
"button": {
"push": {
"name": "Push"
}
},
"number": {
"brightness": {
"name": "Brightness"
},
"carbon_dioxide_alarm_level": {
"name": "Alarm level"
},
"down_position": {
"name": "Down position"
},
"hold_time": {
"name": "Hold time"
},
"reporting_period": {
"name": "Reporting period"
},
"up_position": {
"name": "Up position"
}
},
"select": {
"fingerbot_mode": {
"name": "Mode",
"state": {
"push": "Push",
"switch": "Switch"
}
},
"temperature_unit": {
"name": "Temperature unit"
}
},
"sensor": {
"battery": {
"name": "Battery"
},
"battery_charging": {
"name": "Battery charging",
"state": {
"charged": "Charged",
"charging": "Charging",
"not_charging": "Not charging"
}
},
"battery_state": {
"name": "Battery state",
"state": {
"high": "High",
"low": "Low",
"normal": "Normal"
}
},
"carbon_dioxide": {
"name": "Carbon dioxide"
},
"carbon_dioxide_alarm": {
"name": "Carbon dioxide level",
"state": {
"alarm": "Alarm",
"normal": "Normal"
}
},
"humidity": {
"name": "Humidity"
},
"moisture": {
"name": "Moisture"
},
"signal_strength": {
"name": "Signal strength"
},
"temperature": {
"name": "Temperature"
}
},
"switch": {
"carbon_dioxide_alarm_switch": {
"name": "Alarm enabled"
},
"carbon_dioxide_severely_exceed_alarm": {
"name": "Severely exceed alarm"
},
"low_battery_alarm": {
"name": "Low battery alarm"
},
"manual_control": {
"name": "Manual control"
},
"reverse_positions": {
"name": "Reverse positions"
},
"switch": {
"name": "Switch"
}
}
},
"humidity": {
"name": "Humidity"
},
"moisture": {
"name": "Moisture"
},
"signal_strength": {
"name": "Signal strength"
},
"temperature": {
"name": "Temperature"
}
},
"switch": {
"carbon_dioxide_alarm_switch": {
"name": "Alarm enabled"
},
"carbon_dioxide_severely_exceed_alarm": {
"name": "Severely exceed alarm"
},
"low_battery_alarm": {
"name": "Low battery alarm"
},
"manual_control": {
"name": "Manual control"
},
"reverse_positions": {
"name": "Reverse positions"
},
"switch": {
"name": "Switch"
}
}
},
"options": {
"error": {
"device_not_registered": "Device is not registered in Tuya cloud",
"invalid_auth": "Invalid authentication",
"login_error": "Login error ({code}): {msg}"
},
"step": {
"login": {
"data": {
"access_id": "Tuya IoT Access ID",
"access_secret": "Tuya IoT Access Secret",
"country_code": "Country",
"password": "Password",
"username": "Account"
"options": {
"error": {
"device_not_registered": "Device is not registered in Tuya cloud",
"invalid_auth": "Invalid authentication",
"login_error": "Login error ({code}): {msg}"
},
"description": "Refer to documentation of Tuya integration to retrive the cloud credentials https://www.home-assistant.io/integrations/tuya/\n\nEnter your Tuya credentials."
}
"step": {
"login": {
"data": {
"access_id": "Tuya IoT Access ID",
"access_secret": "Tuya IoT Access Secret",
"country_code": "Country",
"password": "Password",
"username": "Account"
},
"description": "Refer to documentation of Tuya integration to retrive the cloud credentials https://www.home-assistant.io/integrations/tuya/\n\nEnter your Tuya credentials."
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions custom_components/tuya_ble/tuya_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

from .const import (
SERVICE_UUID,
TuyaBLEDataPointType,
TuyaBLEDataPointType,
)
from .manager import (
AbstaractTuyaBLEDeviceManager,
TuyaBLEDeviceCredentials,
)
from .tuya_ble import TuyaBLEDataPoint, TuyaBLEDevice
from .tuya_ble import TuyaBLEDataPoint, TuyaBLEDevice

__all__ = [
"AbstaractTuyaBLEDeviceManager",
Expand Down

0 comments on commit 23c396e

Please sign in to comment.