Skip to content

Commit

Permalink
Redact gateway information in logging (#584)
Browse files Browse the repository at this point in the history
* Redact information in logging

* Update dev environment to 2021.9.0

* Improve templates

* Update requirements_dev.txt
  • Loading branch information
iMicknl authored Sep 23, 2021
1 parent 03bd68f commit d85c122
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 46 deletions.
26 changes: 8 additions & 18 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,40 +65,30 @@ body:
- type: input
id: overkiz_device_model
validations:
required: true
required: false
attributes:
label: Device model
placeholder: e.g. PositionableScreen
description: >
Can be found in the Configuration panel -> Integrations -> Somfy TaHoma -> (x) devices -> Model.
- type: input
id: overkiz_device_type
validations:
required: true
attributes:
label: Device type
placeholder: e.g. io:DimmableLightIOComponent
description: >
Can be found in the Configuration panel -> Integrations -> Somfy TaHoma -> (x) devices. Click on the device and copy the firmware.
- type: markdown
attributes:
value: |
## Details
- type: textarea
id: additional-information
id: logs
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.
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.
render: shell

- type: textarea
id: logs
id: additional-information
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
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:
Expand Down
11 changes: 2 additions & 9 deletions .github/ISSUE_TEMPLATE/unsupported_device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ body:
- type: textarea
id: unsupported_device_log
attributes:
label: Unsupported device log
description: Enable [debug logging](https://github.com/iMicknl/ha-tahoma#enable-debug-logging) and paste the Unsupported device string here. If your device already shows up in Home Assistant, share the firwmare (e.g. `io:DimmableLightIOComponent`), which can be gathered from device detail page.
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.
render: shell
validations:
required: true
Expand All @@ -52,13 +52,6 @@ body:
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: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

- type: markdown
attributes:
value: |
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,15 @@ logger:
### Device not supported
If your device is not visible in the device list of Home Assistant (/config/devices/dashboard), you need to turn on [debug logging](#enable-debug-logging). Copy the debug string from your log and create a [new issue](https://github.com/iMicknl/ha-tahoma/issues/new/choose)
If your device is not visible in the device list of Home Assistant (/config/devices/dashboard), you need to turn on [debug logging](#enable-debug-logging) first. Copy your Home Assistant log (Configuration > Logs) and create a [new issue](https://github.com/iMicknl/ha-tahoma/issues/new/choose).
`DEBUG (MainThread) [custom_components.tahoma] Unsupported TaHoma device (io:DimmableLightIOComponent - Light - DimmableLight).`
### Device not working correctly
If your device is listed in the device list, create a [new issue](https://github.com/iMicknl/ha-tahoma/issues/new/choose) and fill in all details of the issue template.
If your device is listed in the device list, you need to turn on [debug logging](#enable-debug-logging) first. Copy your Home Assistant log (Configuration > Logs) and create a [new issue](https://github.com/iMicknl/ha-tahoma/issues/new/choose).
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.
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 include your log in the issue.

```
2021-01-28 09:20:22 INFO (MainThread) [custom_components.tahoma] 2021-01-27 21:30:00: off executed via Home Assistant on io://xxxx, with [].
2021-01-28 09:20:22 INFO (MainThread) [custom_components.tahoma] 2021-01-27 16:23:29: setIntensity executed via Home Assistant on io://xxxx, with [70].
```

### Retrieve HomeKit code

Expand Down
7 changes: 1 addition & 6 deletions custom_components/tahoma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
device_registry = await dr.async_get_registry(hass)

for gateway in gateways:
_LOGGER.debug(
"Added gateway (%s - %s - %s)",
gateway.id,
gateway.type,
gateway.sub_type,
)
_LOGGER.debug("Added gateway (%s)", gateway)

gateway_model = (
beautify_name(gateway.sub_type.name)
Expand Down
5 changes: 3 additions & 2 deletions custom_components/tahoma/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
MaintenanceException,
TooManyRequestsException,
)
from pyhoma.models import obfuscate_id
import voluptuous as vol

from .const import (
Expand Down Expand Up @@ -162,10 +163,10 @@ async def async_step_dhcp(self, discovery_info):
hostname = discovery_info[HOSTNAME]
gateway_id = hostname[8:22]

_LOGGER.debug("DHCP discovery detected gateway %s", gateway_id)
_LOGGER.debug("DHCP discovery detected gateway %s", obfuscate_id(gateway_id))

if self._gateway_already_configured(gateway_id):
_LOGGER.debug("Gateway %s is already configured", gateway_id)
_LOGGER.debug("Gateway %s is already configured", obfuscate_id(gateway_id))
return self.async_abort(reason="already_configured")

return await self.async_step_user()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyhoma==0.5.18
pyhoma==0.5.20
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r requirements.txt
homeassistant==2021.8.0b0
homeassistant==2021.9.0b2
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r requirements_dev.txt
pytest-homeassistant-custom-component==0.4.3
pytest-homeassistant-custom-component==0.4.4
# required for DHCP discovery test
scapy==2.4.5
aiodiscover==1.4.2

0 comments on commit d85c122

Please sign in to comment.