diff --git a/CHANGELOG.md b/CHANGELOG.md index e39e39d..44158d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,11 @@ All notable changes to this project will be documented in this file. This projec * Update axios to v1.6.2 to address moderate severity vulnerability. ## v4.0.0 -* Added Local UDP API support! Now you can choose to listen to your Weather Stations observations directly over your local network. No Station ID or API Token needed. Observations are broadcasted every 60 seconds. This leverages the `obs_st` message. See [documentation](https://weatherflow.github.io/Tempest/api/udp/v171/) for more information. +* Added Local UDP API support! Now you can choose to listen to your Weather Stations observations directly over your local network. No Station ID or API Token needed. + * To use the local API add `local_api`: `true` or `false` to your top level configuration. + * Observations are broadcasted every 60 seconds. + * Leverages the `obs_st` message. See [documentation](https://weatherflow.github.io/Tempest/api/udp/v171/) for more information. + * `precip_accum_local_day` not available with local API ## v3.0.3 * Update node-version: [18.x, 20.x], remove 16.x which is no longer supported by homebridge. diff --git a/README.md b/README.md index 88bfba6..953a3e2 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ It is recommended when upgrading to v3.0 of the plugin from a prior version that ### Setup and Parameters -You will need to create an account at https://tempestwx.com/ and then generate a Personal Use Token https://tempestwx.com/settings/tokens. +Local API is now supported which requires no authentication. If you choose to use the non-local HTTP API you will need to create an account at https://tempestwx.com/ and then generate a Personal Use Token https://tempestwx.com/settings/tokens. - `name`: _(Required)_ Must always be set to `WeatherFlow Tempest Platform`. - `local_api`: _(Required)_ Use the Local API versus HTTP API. diff --git a/src/platform.ts b/src/platform.ts index 712b6aa..ff1aa4c 100644 --- a/src/platform.ts +++ b/src/platform.ts @@ -61,6 +61,12 @@ export class WeatherFlowTempestPlatform implements DynamicPlatformPlugin { this.tempest_battery_level = 0; this.tempest_device_id = 0; + // Backwards compatible config check for new local_api variable + if (!('local_api' in this.config)) { + this.config['local_api'] = false; + this.log.info('local_api config parameter not set defaulting to false.'); + } + // Make sure the Station ID is the integer ID if ((this.config.local_api === false) && isNaN(this.config.station_id)) { log.warn(