Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions custom_components/c6_zigbee_stick/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
from homeassistant.helpers.service_info.usb import UsbServiceInfo

from . import zboss
from .const import ADAPTER, CONF_DEVICE, CONF_FIRMWARE, CONF_SERIAL, DOMAIN, LOGGER, USB_PID, USB_VID
from .const import (
ADAPTER,
CONF_DEVICE,
CONF_FIRMWARE,
CONF_SERIAL,
DOMAIN,
FLASHER_URL,
LOGGER,
USB_PID,
USB_VID,
)
from .z2m import async_current_serial, async_setup_z2m

TITLE = "C6 Zigbee Stick"
Expand Down Expand Up @@ -77,7 +87,7 @@ async def async_step_usb(self, discovery_info: UsbServiceInfo) -> ConfigFlowResu

if reason := await self._async_check(device, discovery_info.serial_number):
# Silent for USB discovery: other ESP32 boards share this USB id.
return self.async_abort(reason=reason)
return self.async_abort(reason=reason, description_placeholders={"url": FLASHER_URL})

self.context["title_placeholders"] = {"name": TITLE}
return await self.async_step_confirm()
Expand All @@ -104,7 +114,7 @@ async def async_step_user(self, user_input: dict[str, Any] | None = None) -> Con
continue
await self.async_set_unique_id(serial)
return await self.async_step_confirm()
return self.async_abort(reason=last_reason)
return self.async_abort(reason=last_reason, description_placeholders={"url": FLASHER_URL})

async def async_step_confirm(self, user_input: dict[str, Any] | None = None) -> ConfigFlowResult:
"""Show what was found and what will be done."""
Expand Down
1 change: 1 addition & 0 deletions custom_components/c6_zigbee_stick/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# ESP32-C6 built-in USB-Serial/JTAG. Fixed in silicon, so every C6 board looks like this;
# the ZBOSS probe tells our coordinator apart from other ESP32 firmware.
FLASHER_URL = "https://f1devbin.github.io/c6-zigbee-stick/"
USB_VID = "303A"
USB_PID = "1001"

Expand Down
2 changes: 2 additions & 0 deletions custom_components/c6_zigbee_stick/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"domain": "c6_zigbee_stick",
"name": "C6 Zigbee Stick",
"after_dependencies": ["hassio", "mqtt"],
"categories": ["hubs_protocols.wireless_protocols", "diy_makers.boards_hardware"],
"codeowners": ["@f1devbin"],
"config_flow": true,
"connectivity": ["zigbee"],
"dependencies": ["usb"],
"documentation": "https://github.com/f1devbin/c6-zigbee-stick",
"integration_type": "device",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/c6_zigbee_stick/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"abort": {
"already_configured": "This stick is already set up.",
"no_devices_found": "No ESP32-C6 is connected over USB.",
"not_zboss": "The ESP32-C6 does not answer as a Zigbee coordinator. Flash the coordinator firmware first: https://f1devbin.github.io/c6-zigbee-stick/",
"not_zboss": "The ESP32-C6 does not answer as a Zigbee coordinator. Flash the coordinator firmware first: {url}",
"port_busy": "The port is in use by another program.",
"z2m_other_adapter": "Zigbee2MQTT already works with another adapter, so it was left as it is.",
"z2m_setup_failed": "Zigbee2MQTT could not be set up: {error}"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/c6_zigbee_stick/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"abort": {
"already_configured": "This stick is already set up.",
"no_devices_found": "No ESP32-C6 is connected over USB.",
"not_zboss": "The ESP32-C6 does not answer as a Zigbee coordinator. Flash the coordinator firmware first: https://f1devbin.github.io/c6-zigbee-stick/",
"not_zboss": "The ESP32-C6 does not answer as a Zigbee coordinator. Flash the coordinator firmware first: {url}",
"port_busy": "The port is in use by another program.",
"z2m_other_adapter": "Zigbee2MQTT already works with another adapter, so it was left as it is.",
"z2m_setup_failed": "Zigbee2MQTT could not be set up: {error}"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/c6_zigbee_stick/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"abort": {
"already_configured": "Этот стик уже настроен.",
"no_devices_found": "ESP32-C6 по USB не подключена.",
"not_zboss": "ESP32-C6 не отвечает как Zigbee-координатор. Сначала прошейте её: https://f1devbin.github.io/c6-zigbee-stick/",
"not_zboss": "ESP32-C6 не отвечает как Zigbee-координатор. Сначала прошейте её: {url}",
"port_busy": "Порт занят другой программой.",
"z2m_other_adapter": "Zigbee2MQTT уже работает с другим адаптером, поэтому его не трогали.",
"z2m_setup_failed": "Не удалось настроить Zigbee2MQTT: {error}"
Expand Down
Loading