mirror of
https://github.com/adrianjagielak/home-assistant-futurehome.git
synced 2026-01-18 15:45:38 +00:00
Add support for 'water_heater' service
This commit is contained in:
@@ -3,7 +3,7 @@ import { log } from './logger';
|
||||
import { FimpResponse, sendFimpMsg, setFimp } from './fimp/fimp';
|
||||
import { haCommandHandlers, setHa, setHaCommandHandlers } from './ha/globals';
|
||||
import { CommandHandlers, haPublishDevice } from './ha/publish_device';
|
||||
import { haUpdateState, haUpdateStateSensorReport } from './ha/update_state';
|
||||
import { haUpdateState, haUpdateStateValueReport } from './ha/update_state';
|
||||
import { VinculumPd7Device } from './fimp/vinculum_pd7_device';
|
||||
import { haUpdateAvailability } from './ha/update_availability';
|
||||
import { delay } from './utils';
|
||||
@@ -229,25 +229,6 @@ import { delay } from './utils';
|
||||
break;
|
||||
}
|
||||
|
||||
case 'evt.alarm.report':
|
||||
case 'evt.binary.report':
|
||||
case 'evt.color.report':
|
||||
case 'evt.lvl.report':
|
||||
case 'evt.mode.report':
|
||||
case 'evt.open.report':
|
||||
case 'evt.presence.report':
|
||||
case 'evt.scene.report':
|
||||
case 'evt.sensor.report':
|
||||
case 'evt.setpoint.report':
|
||||
case 'evt.state.report': {
|
||||
haUpdateStateSensorReport({
|
||||
topic,
|
||||
value: msg.val,
|
||||
attrName: msg.type.split('.')[1],
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case 'evt.network.all_nodes_report': {
|
||||
const devicesAvailability = msg.val;
|
||||
if (!devicesAvailability) {
|
||||
@@ -259,6 +240,17 @@ import { delay } from './utils';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
// Handle any event that matches the pattern: evt.<something>.report
|
||||
if (/^evt\..+\.report$/.test(msg.type ?? '')) {
|
||||
haUpdateStateValueReport({
|
||||
topic,
|
||||
value: msg.val,
|
||||
attrName: msg.type!.split('.')[1],
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
log.warn('Bad FIMP JSON', e, topic, buf);
|
||||
|
||||
Reference in New Issue
Block a user