Skip to content

Commit

Permalink
* Fixed an issue where the setting value for the addon configuration …
Browse files Browse the repository at this point in the history
…`Mqtt.AutoConfig` could not be read.

* If you are configuring DockerCompose yourself instead of using the Home Assistant addon, please modify `options.json` from `Mqtt.UseAutoConfig` to `Mqtt.AutoConfig`.
  • Loading branch information
hsakoh committed Feb 12, 2024
1 parent b8a26c9 commit 4e058eb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Enhanced HAN」※2 対応のものは<br>コマンドの引数や使い方が
|BRoute:ForcePANScan|`false`|PANスキャンを起動時に強制する場合、`true`を指定します<br>`false`の場合、過去の接続時のPANを参照する為、再起動時等で再接続が早くなります|
|BRoute:PanDescSavePath|`/data/EPANDESC.json`|PANの情報を保存する先を指定します|
|BRoute:InstantaneousValueInterval|`00:01:10`|瞬時値の周期的な取得間隔を指定します<br>TimeSpan(`HH:mm:ss`)形式で記述します|
|Mqtt:UseAutoConfig|true|デフォルトのHome Assistant Mosquitto統合を使用しているアドオンユーザーは、Home Assistant Supervisor APIを介して接続の詳細を検出できるため、この値をTrueに設定できます。|
|Mqtt:AutoConfig|true|デフォルトのHome Assistant Mosquitto統合を使用しているアドオンユーザーは、Home Assistant Supervisor APIを介して接続の詳細を検出できるため、この値をTrueに設定できます。|
|Mqtt:Host|-|MQTTブローカー<br>ホスト名を指定します|
|Mqtt:Port|`1883`|ポート番号を指定します|
|Mqtt:Id|-|認証がある場合、IDを指定します|
Expand Down
2 changes: 1 addition & 1 deletion src/BRouteMqttApp/appsettings.Development_Example.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"InstantaneousValueInterval": "00:01:00"
},
"Mqtt": {
"UseAutoConfig": false,
"AutoConfig": false,
"Host": "homeassistant",
"Port": 1883,
"Id": "",
Expand Down
2 changes: 1 addition & 1 deletion src/HomeAssistant/HomeAssistantAddOn.Mqtt/MqttOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace HomeAssistantAddOn.Mqtt;
public class MqttOptions
{
public bool UseAutoConfig { get; set; } = true;
public bool AutoConfig { get; set; } = true;

public string? Host { get; set; } = null;

Expand Down
4 changes: 2 additions & 2 deletions src/HomeAssistant/HomeAssistantAddOn.Mqtt/MqttService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task StartAsync()
{
var options = _optionsMonitor.CurrentValue;
SupervisorApi.ServiceMqtt? serviceMqtt = null;
if (options.UseAutoConfig)
if (options.AutoConfig)
{
var response = await _supervisorApi.GetServicesMqtt();
if (response?.Result != "ok")
Expand All @@ -50,7 +50,7 @@ public async Task StartAsync()
.WithClientOptions((builder) =>
{
var options = _optionsMonitor.CurrentValue;
if (options.UseAutoConfig)
if (options.AutoConfig)
{
builder
.WithTcpServer(serviceMqtt!.Host, serviceMqtt.Port)
Expand Down

0 comments on commit 4e058eb

Please sign in to comment.