Skip to content

Commit

Permalink
Fix account duplicate and change category (rospogrigio#14)
Browse files Browse the repository at this point in the history
* change category

* abort process if ID Configured

* clarify already configured message.
  • Loading branch information
xZetsubou authored Aug 21, 2023
1 parent 815c20b commit fadaee8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions custom_components/localtuya/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ async def _create_entry(self, user_input):
# return self.async_abort(reason="already_configured")

await self.async_set_unique_id(user_input.get(CONF_USER_ID))
self._abort_if_unique_id_configured()

user_input[CONF_DEVICES] = {}

return self.async_create_entry(
Expand Down
14 changes: 8 additions & 6 deletions custom_components/localtuya/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"domain": "localtuya",
"name": "LocalTuya integration",
"version": "5.0.0",
"documentation": "https://github.com/xZetsubou/hass-localtuya/",
"dependencies": [],
"codeowners": [
"@rospogrigio", "@postlund"
],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/rospogrigio/localtuya/",
"iot_class": "local_push",
"issue_tracker": "https://github.com/rospogrigio/localtuya/issues",
"issue_tracker": "https://github.com/xZetsubou/hass-localtuya/issues",
"requirements": [],
"version": "5.2.1"
"integration_type": "hub",
"config_flow": true,
"iot_class": "local_push"

}
2 changes: 1 addition & 1 deletion custom_components/localtuya/strings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Device has already been configured.",
"already_configured": "This Account ID has already been configured.",
"unsupported_device_type": "Unsupported device type!"
},
"error": {
Expand Down
4 changes: 2 additions & 2 deletions custom_components/localtuya/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Device has already been configured.",
"already_configured": "This Account ID has already been configured.",
"device_updated": "Device configuration has been updated!"
},
"error": {
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"options": {
"abort": {
"already_configured": "Device has already been configured.",
"already_configured": "This Account ID has already been configured.",
"device_success": "Device {dev_name} successfully {action}.",
"no_entities": "Cannot remove all entities from a device.\nIf you want to delete a device, enter it in the Devices menu, click the 3 dots in the 'Device info' frame, and press the Delete button."
},
Expand Down

0 comments on commit fadaee8

Please sign in to comment.