1.1.3 - Fix compatibility with Home Assistant 0.87 MQTT strict config

This commit is contained in:
Ryan Wagoner 2019-02-10 17:31:22 -05:00
parent 09637316a5
commit a9c52b433f
4 changed files with 17 additions and 9 deletions

View file

@ -8,8 +8,6 @@ namespace OmniLinkBridge.MQTT
{
public class Alarm : Device
{
public string basic_state_topic { get; set; }
public string command_topic { get; set; }
//public string code { get; set; } = string.Empty;

View file

@ -363,20 +363,23 @@ namespace OmniLinkBridge.Modules
for (ushort i = 1; i < OmniLink.Controller.Units.Count; i++)
{
string type = i < 385 ? "light" : "switch";
clsUnit unit = OmniLink.Controller.Units[i];
if (unit.DefaultProperties == true || Global.mqtt_discovery_ignore_units.Contains(unit.Number))
{
string type = i < 385 ? "light" : "switch";
MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/{type}/{Global.mqtt_prefix}/unit{i.ToString()}/config", null, MqttQualityOfServiceLevel.AtMostOnce, true);
continue;
}
PublishUnitState(unit);
MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/{type}/{Global.mqtt_prefix}/unit{i.ToString()}/config",
JsonConvert.SerializeObject(unit.ToConfig()), MqttQualityOfServiceLevel.AtMostOnce, true);
if(i < 385)
MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/light/{Global.mqtt_prefix}/unit{i.ToString()}/config",
JsonConvert.SerializeObject(unit.ToConfig()), MqttQualityOfServiceLevel.AtMostOnce, true);
else
MqttClient.PublishAsync($"{Global.mqtt_discovery_prefix}/switch/{Global.mqtt_prefix}/unit{i.ToString()}/config",
JsonConvert.SerializeObject(unit.ToConfigSwitch()), MqttQualityOfServiceLevel.AtMostOnce, true);
}
}

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.2.0")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]

View file

@ -2,7 +2,7 @@
Provides MQTT bridge, web service API, time sync, and logging for [HAI/Leviton OmniPro II controllers](https://www.leviton.com/en/products/brands/omni-security-automation). Provides integration with [Samsung SmarthThings via web service API](https://github.com/excaliburpartners/SmartThings-OmniPro) and [Home Assistant via MQTT](https://www.home-assistant.io/components/mqtt/).
## Download
You can use docker to build an image from git or download the [binary here](http://www.excalibur-partners.com/downloads/OmniLinkBridge_1_1_2.zip).
You can use docker to build an image from git or download the [binary here](http://www.excalibur-partners.com/downloads/OmniLinkBridge_1_1_3.zip).
## Requirements
- [Docker](https://www.docker.com/)
@ -184,6 +184,13 @@ string ON
```
## Change Log
Version 1.1.3 - 2019-02-10
- Publish config when reconnecting to MQTT
- Update readme documentation
- Add override zone type for web service
- Add area json status and climate temp sensor
- Fix compatibility with Home Assistant 0.87 MQTT strict config
Version 1.1.2 - 2018-10-23
- Add min and max climate temperatures
- Update docker run command to use local time zone