add payloads for binary_sensor support
This commit is contained in:
parent
bf88193d24
commit
efb3bffc4c
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "onstar2mqtt",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -149,6 +149,8 @@ class MQTT {
|
||||
availability_topic: this.getAvailabilityTopic(),
|
||||
payload_available: 'true',
|
||||
payload_not_available: 'false',
|
||||
payload_on: 'true',
|
||||
payload_off: 'false',
|
||||
state_topic: this.getStateTopic(diag),
|
||||
unit_of_measurement: diagEl.unit,
|
||||
value_template: `{{ value_json.${MQTT.convertName(diagEl.name)} }}`,
|
||||
|
@ -72,6 +72,8 @@ describe('MQTT', () => {
|
||||
name: 'Ambient Air Temperature',
|
||||
payload_available: 'true',
|
||||
payload_not_available: 'false',
|
||||
payload_off: 'false',
|
||||
payload_on: 'true',
|
||||
state_topic: 'homeassistant/sensor/XXX/ambient_air_temperature/state',
|
||||
unit_of_measurement: '°C',
|
||||
value_template: '{{ value_json.ambient_air_temperature }}'
|
||||
@ -102,6 +104,8 @@ describe('MQTT', () => {
|
||||
name: 'Priority Charge Indicator',
|
||||
payload_available: 'true',
|
||||
payload_not_available: 'false',
|
||||
payload_off: 'false',
|
||||
payload_on: 'true',
|
||||
state_topic: 'homeassistant/binary_sensor/XXX/ev_charge_state/state',
|
||||
unit_of_measurement: undefined,
|
||||
value_template: '{{ value_json.priority_charge_indicator }}'
|
||||
@ -134,6 +138,8 @@ describe('MQTT', () => {
|
||||
name: 'Tire Pressure: Left Front',
|
||||
payload_available: 'true',
|
||||
payload_not_available: 'false',
|
||||
payload_off: 'false',
|
||||
payload_on: 'true',
|
||||
state_topic: 'homeassistant/sensor/XXX/tire_pressure/state',
|
||||
unit_of_measurement: 'kPa',
|
||||
value_template: '{{ value_json.tire_pressure_lf }}'
|
||||
|
Loading…
Reference in New Issue
Block a user