Skip to content

Commit

Permalink
fixing pre-commit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adechant committed Oct 9, 2023
1 parent 7656c30 commit f5c12ca
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 38 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ https://vscode.dev can't be opened in an iframe, so this will not work as a side

**This component will set up the following platforms.**

| Platform | Description |
| --------------- | -------------------------------------------------------------------------- |
| `switch` | VSCode tunnel in your HA Docker container. Turn it on/off with the switch |
| Platform | Description |
| --------- | -------------------------------------------------------------------------- |
| `switch` | VSCode tunnel in your HA Docker container. Turn it on/off with the switch |

## Manual Installation

Expand All @@ -45,9 +45,9 @@ https://vscode.dev can't be opened in an iframe, so this will not work as a side
5. Place the files you downloaded in the new directory (folder) you created.
6. Restart Home Assistant
7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Home Assistant"
6. Turn on the VSCode Tunnel Switch entity to start the tunnel.
7. Go to https://vscode.dev/your_tunnel_name to access your home assistant files (configuartion.yaml, etc)
8. Turn off the VScode Tunnel Switch if you want to stop the tunnel and the associated external connection.
8. Turn on the VSCode Tunnel Switch entity to start the tunnel.
9. Go to https://vscode.dev/your_tunnel_name to access your home assistant files (configuartion.yaml, etc)
10. Turn off the VScode Tunnel Switch if you want to stop the tunnel and the associated external connection.

Using your HA configuration directory (folder) as a starting point you should now also have this:

Expand Down
8 changes: 4 additions & 4 deletions custom_components/ha_vscode/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
"""Adds config flow for VSCode HA Tunnel."""
from awesomeversion import AwesomeVersion
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import __version__ as HAVERSION
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.event import async_call_later
from homeassistant.loader import async_get_integration
from homeassistant.helpers.storage import STORAGE_DIR
import voluptuous as vol
from .vscode_device import VSCodeDeviceAPI
from .exceptions import *
from homeassistant.loader import async_get_integration
import logging
import os.path
from .const import *
from .exceptions import *
from .vscode_device import VSCodeDeviceAPI

LOGGER: logging.Logger = logging.getLogger(PACKAGE_NAME)

Expand Down
3 changes: 1 addition & 2 deletions custom_components/ha_vscode/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
"config_flow": true,
"codeowners": ["@adechant"],
"requirements": [],
"iot_class": "local_polling",
"integration": "device"
"iot_class": "local_polling"
}
4 changes: 2 additions & 2 deletions custom_components/ha_vscode/switch.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import re
from .vscode_device import VSCodeDeviceAPI
from homeassistant.const import UnitOfInformation
from homeassistant.components.switch import (
SwitchEntity,
SwitchDeviceClass,
)
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
import re
from .vscode_device import VSCodeDeviceAPI


async def async_setup_entry(hass, config, async_add_devices):
Expand Down
34 changes: 17 additions & 17 deletions custom_components/ha_vscode/translations/en.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"config": {
"abort": {
"single_instance_allowed": "Only a single configuration of HACS is allowed.",
"min_ha_version": "You need at least version {version} of Home Assistant to setup HACS.",
"authentication": "Could not authenticate with GitHub, try again later.",
"download": "Neither curl nor wget are available on your system. Please install one or the other and try again.",
"zip": "Unzipping and untarring the downloaded file failed. Please check the system logs.",
"unknown": "An unknown error occurred. Please check the system logs."
"single_instance_allowed": "Only a single configuration of HACS is allowed.",
"min_ha_version": "You need at least version {version} of Home Assistant to setup HACS.",
"authentication": "Could not authenticate with GitHub, try again later.",
"download": "Neither curl nor wget are available on your system. Please install one or the other and try again.",
"zip": "Unzipping and untarring the downloaded file failed. Please check the system logs.",
"unknown": "An unknown error occurred. Please check the system logs."
},
"error": {
"single_instance_allowed": "Only a single configuration of HACS is allowed.",
"min_ha_version": "You need at least version {version} of Home Assistant to setup HACS.",
"authentication": "Could not authenticate with GitHub, try again later.",
"download": "Neither curl nor wget are available on your system. Please install one or the other and try again.",
"zip": "Unzipping and untarring the downloaded file failed. Please check the system logs.",
"unknown": "An unknown error occurred. Please check the system logs."
"single_instance_allowed": "Only a single configuration of HACS is allowed.",
"min_ha_version": "You need at least version {version} of Home Assistant to setup HACS.",
"authentication": "Could not authenticate with GitHub, try again later.",
"download": "Neither curl nor wget are available on your system. Please install one or the other and try again.",
"zip": "Unzipping and untarring the downloaded file failed. Please check the system logs.",
"unknown": "An unknown error occurred. Please check the system logs."
},
"step": {
"user": {
Expand All @@ -23,15 +23,15 @@
}
},
"progress": {
"wait_for_oauth": "Generating OAuth token. Please wait while the tunnel is started.",
"wait_for_activation": "1. Open {url} \n2. Paste the following token to authorize your VSCode tunnel: \n```\n{token}\n```\n"
"wait_for_oauth": "Generating OAuth token. Please wait while the tunnel is started.",
"wait_for_activation": "1. Open {url} \n2. Paste the following token to authorize your VSCode tunnel: \n```\n{token}\n```\n"
}
},
"options": {
"abort": {
"not_setup": "HA VSCode Tunnel is not setup.",
"no_reauth_needed": "HA VSCode Tunnel is up and running!",
"reauth_error": "Tunnel re-authorization failed. Please try again later!"
"not_setup": "HA VSCode Tunnel is not setup.",
"no_reauth_needed": "HA VSCode Tunnel is up and running!",
"reauth_error": "Tunnel re-authorization failed. Please try again later!"
},
"step": {
"user": {
Expand Down
10 changes: 6 additions & 4 deletions custom_components/ha_vscode/vscode_device.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import subprocess
import time

import asyncio
import re
import os
import logging
import os
import os.path
import re
import subprocess
from threading import Thread, Lock
import time

from .const import PACKAGE_NAME
from .exceptions import (
Expand Down Expand Up @@ -381,3 +382,4 @@ def main():

if __name__ == "__main__":
main()

6 changes: 3 additions & 3 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

**This component will set up the following platforms.**

| Platform | Description |
| --------------- | -------------------------------------------------------------------------- |
| `switch` | VSCode tunnel in your HA Docker container. Turn it on/off with the switch |
| Platform | Description |
| --------- | -------------------------------------------------------------------------- |
| `switch` | VSCode tunnel in your HA Docker container. Turn it on/off with the switch |



Expand Down

0 comments on commit f5c12ca

Please sign in to comment.