Skip to content

Commit

Permalink
update readme and show complete config form
Browse files Browse the repository at this point in the history
  • Loading branch information
SanterreJo committed Apr 12, 2024
1 parent c4af4f6 commit 437a1ff
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
⚠️ Hilo a retiré la méthode de connexion par nom d'utilisateur et mot de passe à partir du 10 avril 2024. Le plugin ne fonctionnera plus jusqu'à ce qu'une nouvelle version soit publiée ⚠️

⚠️ Hilo deprecated the username/password login method as of April 10th 2024. The plugin will no longer work until a new version is released ⚠️
⚠️ Hilo a retiré la méthode de connexion par nom d'utilisateur et mot de passe à partir du 10 avril 2024. Les versions 1.X.X ne fonctionnent plus. Veuillez installer la version 2.0.0 ou supérieur ⚠️

⚠️ Hilo deprecated the username/password login method as of April 10th 2024. Versions 1.X.X no longer work. You must install version 2.0.0 or higher. ⚠️

# homebridge-hilo
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
Expand All @@ -19,22 +18,20 @@ Note: Ceci n'est pas un plugin officiel, le plugin n'est pas affilié avec Hilo
## Installation
1. Installer Homebridge en suivant
[les instructions](https://github.com/homebridge/homebridge/wiki).
2. Installer le plugin en utilisant [Homebridge Config UI X (RECOMMANDÉ)](https://github.com/oznu/homebridge-config-ui-x), ou en exécutant `npm install -g homebridge-hilo`.
2. Installer le plugin en utilisant [Homebridge Config UI X (REQUIS)](https://github.com/oznu/homebridge-config-ui-x), ou en exécutant `npm install -g homebridge-hilo`.

## Configuration
Pour que le plugin soit fonctionnel, il doit avoir accès à votre compte Hilo

Vous pouvez fournir votre nom d'utilisateur / mot de passe lors du processus d'installation fournit par [Homebridge Config UI X (RECOMMANDÉ)](https://github.com/oznu/homebridge-config-ui-x),
ou en ajoutant la configuration suivante à HomeBridge [homebridge](https://github.com/homebridge/homebridge/wiki/Homebridge-Config-JSON-Explained)
Vous devrez vous connecter à votre compte Hilo lors du processus d'installation fournit par [Homebridge Config UI X (REQUIS)](https://github.com/oznu/homebridge-config-ui-x)

```json
{
"platforms": [
{
"platform": "Hilo",
"username": "monemail@exemple.com",
"password": "***************",
"noChallengeSensor": false
"noChallengeSensor": false,
"plannedHours": 2
}
]
}
Expand Down Expand Up @@ -71,22 +68,21 @@ Note: This is not an official plugin, this plugin is not affiliated with Hilo no
## Installation
1. Install Homebridge by following
[the instructions](https://github.com/homebridge/homebridge/wiki).
2. Install this plugin using [Homebridge Config UI X (RECOMMENDED)](https://github.com/oznu/homebridge-config-ui-x), or by running `npm install -g homebridge-hilo`.
2. Install this plugin using [Homebridge Config UI X (REQUIRED)](https://github.com/oznu/homebridge-config-ui-x), or by running `npm install -g homebridge-hilo`.

## Configuration
For the plugin to work, it needs access to your Hilo account

You can provide your username/password via the installation process provided by [Homebridge Config UI X (RECOMMENDED)](https://github.com/oznu/homebridge-config-ui-x),
You will need to login to your Hilo account during the installation process provided by [Homebridge Config UI X (REQUIRED)](https://github.com/oznu/homebridge-config-ui-x),
or by adding the following configuration to [homebridge](https://github.com/homebridge/homebridge/wiki/Homebridge-Config-JSON-Explained)

```json
{
"platforms": [
{
"platform": "Hilo",
"username": "myemail@example.com",
"password": "***************",
"noChallengeSensor": false
"noChallengeSensor": false,
"plannedHours": 2
}
]
}
Expand Down
12 changes: 12 additions & 0 deletions homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<div class="card">
<ol>
<li>You will need to know the IP address or the domain name you use to connect to homebridge. Usually it will be the address in your browser</li>
<li>Click on the button below to start the authentication process</li>
<li>Login to your hilo account</li>
<li>Click on the "Authorize" button</li>
<li>Enter the ip address or domain name you took not at step 1 and add the port 8880 at the end. Examples: http://192.168.0.10:8880 http://homebridge.local:8880</li>
<li>Click on the "Link account" button</li>
<li>You can save your config and restart your homebridge server</li>
</ol>
<button type="button" class="btn btn-primary" onclick="initiateAuth()">
Login with Hilo
</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/@badgateway/oauth2-client@2.3.0/browser/oauth2-client.min.js"></script>
<script>
homebridge.showSchemaForm();
async function initiateAuth() {
const state = Math.random().toString(36).substring(7);
const client = new OAuth2Client.OAuth2Client({
Expand Down Expand Up @@ -39,5 +49,7 @@
return block;
});
await homebridge.updatePluginConfig(pluginConfigBlocks);
await homebridge.savePluginConfig();
homebridge.toast.success("Successfully authenticated with Hilo");
}
</script>
4 changes: 0 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { PlatformConfig } from "homebridge";

export type HiloConfig = PlatformConfig & {
username: string;
password: string;
noChallengeSensor: boolean;
plannedHours: number;
};

const defaultConfig: Partial<HiloConfig> = {
username: "",
password: "",
noChallengeSensor: false,
plannedHours: 2,
};
Expand Down
5 changes: 1 addition & 4 deletions src/hiloApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ const unableToLogin = (e: unknown) => {
const logger = getLogger();
logger.error("Unable to login", axios.isAxiosError(e) ? e.response?.data : e);
logger.error(
"Hilo deprecated the username/password login method as of April 10th 2024. The plugin will no longer work until a new version is released"
);
logger.error(
"Hilo a retiré la méthode de connexion par nom d'utilisateur et mot de passe à partir du 10 avril 2024. Le plugin ne fonctionnera plus jusqu'à ce qu'une nouvelle version soit publiée"
"You can try to refresh your login credentials by using the 'Login with Hilo' button in the plugin configuration in homebridge UI"
);
};

0 comments on commit 437a1ff

Please sign in to comment.