chickenandpork / hass-osbee

Simple integration for OpenSprinkler Bee (OSBee) irrigation controller in Home Assistant
MIT License
0 stars 0 forks source link

Feature: Configurable token #6

Closed chickenandpork closed 1 year ago

chickenandpork commented 1 year ago

Permit the configuration of a non-default token to talk to the OSBee

The default token for the OSBee was hard-coded for expediency; this PR allows a different value to be set:

binary_sensor:
  - platform: osbee
    host: 192.168.1.22
    token: BobIsAGiant

sensor:
  - platform: osbee
    host: 192.168.1.22
    token: BobIsAGiant

switch:
  - platform: osbee
    host: 192.168.1.22
    token: BobIsAGiant

Configuration is still redundant: the first block that is recognized and creates the OSBeeAPI proxy object is the token that gets used. Note that multi-threaded setup can give inconsistent results if different tokens are currently given for switch/sensor/binary_sensor.