From d9056f7f1266a0274511c9830b05151c75d0b4a6 Mon Sep 17 00:00:00 2001 From: vlebourl Date: Tue, 26 Apr 2022 15:22:02 +0200 Subject: [PATCH] fix diagnostics. --- .github/ISSUE_TEMPLATE/bug_report.yaml | 85 +++++++++++++++++++ .../ISSUE_TEMPLATE/unsupported_device.yaml | 56 ++++++++++++ custom_components/vesync/diagnostics.py | 6 +- 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yaml create mode 100644 .github/ISSUE_TEMPLATE/unsupported_device.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 0000000..a25121f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,85 @@ +name: Bug Report +description: Create a report to help us improve the integration +labels: [bug] +body: + + - type: textarea + validations: + required: true + attributes: + label: The problem + description: >- + Describe the issue you are experiencing here to communicate to the + maintainers. Tell us what you were trying to do and what happened. + + Provide a clear and concise description of what the problem is. What did you expect to happen? + + - type: markdown + attributes: + value: | + ## Environment + + - type: input + id: version + validations: + required: true + attributes: + label: What version of this integration has the issue? + placeholder: 2.5.0 + description: > + Can be found in the Configuration panel -> Info. + + - type: input + id: ha_version + validations: + required: true + attributes: + label: What version of Home Assistant Core has the issue? + placeholder: core- + description: > + Can be found in the Configuration panel -> Info. + + - type: markdown + attributes: + value: | + ## Device + + - type: textarea + id: vesync_diagnostics + validations: + required: true + attributes: + label: Diagnostics + placeholder: "{}" + description: > + Can be found in the Configuration panel -> Integrations -> VeSync -> Diagnostics + + - type: markdown + attributes: + value: | + ## Details + + - type: textarea + id: logs + attributes: + label: Home Assistant log + description: Enable debug logging and paste your full log here. Don't forget to redact sensitive information. + value: | +
Logs + + ```py + Copy/paste any log here, between the starting and ending backticks. + ``` + +
+ + - type: textarea + id: additional-information + attributes: + label: Additional information + description: If you have any additional information for us, use the field below. Please note, you can attach screenshots or screen recordings here, by dragging and dropping files in the field below. + + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/unsupported_device.yaml b/.github/ISSUE_TEMPLATE/unsupported_device.yaml new file mode 100644 index 0000000..8ae5416 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/unsupported_device.yaml @@ -0,0 +1,56 @@ +name: Unsupported Device +description: Let's have a look if we can support your device +title: "Add support for ..." +labels: [new-device] +body: + + - type: markdown + attributes: + value: | + ## Device + + - type: textarea + id: unsupported_device_log + attributes: + label: Home Assistant log + description: Enable [debug logging](https://github.com/iMicknl/ha-tahoma#enable-debug-logging) and paste your full log here. We redact your id's and emailaddresses by default. + value: | +
Logs + + ``` + Copy/paste any log here, between the starting and ending backticks. The first log line must start with "Added device (Device...". + ``` + +
+ + - type: textarea + id: device_command_log + validations: + required: true + attributes: + label: Device commands + description: In order to gather more information, you can use the `tahoma.get_execution_history` service which will print your execution history to the Home Assistant log. Run the commands via the official vendor app (e.g. TaHoma) and capture the commands. [Read more](https://github.com/iMicknl/ha-tahoma#device-not-working-correctly). + value: | +
Commands logs + + ``` + Copy/paste your execution history here. + ``` + +
+ + - type: markdown + attributes: + value: | + ## Details + + - type: textarea + id: additional-information + attributes: + label: Additional information + description: If you have any additional information for us, use the field below. Please note, you can attach screenshots or screen recordings here, by dragging and dropping files in the field below. + + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this request! \ No newline at end of file diff --git a/custom_components/vesync/diagnostics.py b/custom_components/vesync/diagnostics.py index 9a2ff07..186fc2f 100644 --- a/custom_components/vesync/diagnostics.py +++ b/custom_components/vesync/diagnostics.py @@ -18,6 +18,10 @@ async def async_get_config_entry_diagnostics( for type in ["fans", "outlets", "switches", "bulbs"]: for d in data["manager"]._dev_list[type]: devices[type].append( - {"device": d.config_dict, "config": d.config, "details": d.details} + { + "device": d.config_dict or {}, + "config": d.config or {}, + "details": d.details or {}, + } ) return devices