Skip to content

Commit

Permalink
last minute backwards config compatibility for easier transition to 4…
Browse files Browse the repository at this point in the history
….0.0
  • Loading branch information
chasenicholl committed Nov 28, 2023
1 parent 33d9df8 commit f7a61a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).

## 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.
Expand Down
6 changes: 6 additions & 0 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f7a61a7

Please sign in to comment.