Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Acgua committed Mar 27, 2023
1 parent 86c7b88 commit f4ac717
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Once this ioBroker.fully-mqtt adapter is tested accordingly and runs stable, I w
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**

- (Acgua) Fixed starting MQTT server
- (Acgua) Removed info log 'MQTT is not activated in adapter instance settings.'

### 0.1.0 (2023-03-27)

- (Acgua) **Breaking Change**: Using MQTT is required, and removed option to deactivate MQTT. Reasons: 1. requesting info thru REST API is redundant and simply not needed since MQTT is available, 2. It does not make sense to not use MQTT since it provides live updates of states.
Expand Down
13 changes: 2 additions & 11 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/main.js.map

Large diffs are not rendered by default.

16 changes: 2 additions & 14 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class FullyMqtt extends utils.Adapter {
public isIpAddressValid = isIpAddressValid.bind(this);
// MQTT
private mqtt_Server: MqttServer | undefined;
public mqtt_useMqtt: true | false = false; // Is use of MQTT activated per adapter settings (each line of fully devices is checked)

// REST API
private restApi_inst = new RestApiFully(this); // RestApi Class Instance
Expand Down Expand Up @@ -91,10 +90,8 @@ export class FullyMqtt extends utils.Adapter {
/**
* Start MQTT Server
*/
if (this.mqtt_useMqtt) {
this.mqtt_Server = new MqttServer(this);
this.mqtt_Server.start();
}
this.mqtt_Server = new MqttServer(this);
this.mqtt_Server.start();

/**
* Call main() for each device
Expand Down Expand Up @@ -331,16 +328,7 @@ export class FullyMqtt extends utils.Adapter {
logConfig.restPassword = '(hidden)'; // do not show password in log !
this.log.debug(`Final Config: ${JSON.stringify(logConfig)}`);
if (lpDevice.enabled) {
// if MQTT is activated, set variable to true
if (lpDevice.useMQTT) {
this.mqtt_useMqtt = true;
this.log.info(`${finalDevice.name} (${finalDevice.ip}) MQTT is activated in adapter instance settings.`);
} else {
this.log.info(`${finalDevice.name} (${finalDevice.ip}) MQTT is not activated in adapter instance settings.`);
}

// Finalize

this.fullys[finalDevice.ip] = finalDevice;
this.activeDeviceIPs.push(lpDevice.ip); // global array for all active IPs
this.log.info(`🗸 ${finalDevice.name} (${finalDevice.ip}): Config successfully verified.`);
Expand Down

0 comments on commit f4ac717

Please sign in to comment.