Skip to content

Commit

Permalink
Update logging level for target position setting in shellyUpdateHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Dec 7, 2024
1 parent b0264c8 commit e19a408
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/platformUpdateHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
WindowCovering,
WindowCoveringCluster,
} from 'matterbridge';
import { db, debugStringify, dn, hk, idn, or, rs, YELLOW, zb } from 'matterbridge/logger';
import { db, debugStringify, dn, er, hk, idn, or, rs, YELLOW, zb } from 'matterbridge/logger';
import { isValidArray, isValidBoolean, isValidNumber, isValidObject, isValidString, rgbColorToHslColor } from 'matterbridge/utils';

import { ShellyDevice } from './shellyDevice.js';
Expand Down Expand Up @@ -276,10 +276,10 @@ export function shellyUpdateHandler(
const status = WindowCovering.MovementStatus.Stopped;
matterbridgeDevice.setAttribute(WindowCoveringCluster.id, 'operationalStatus', { global: status, lift: status, tilt: status }, shellyDevice.log, endpoint);
setTimeout(() => {
shellyDevice.log.info(`Setting target position to current position on endpoint ${or}${endpoint.name}:${endpoint.number}${db}`);
shellyDevice.log.debug(`Setting target position to current position on endpoint ${or}${endpoint.name}:${endpoint.number}${db}`);
const current = matterbridgeDevice.getAttribute(WindowCoveringCluster.id, 'currentPositionLiftPercent100ths', shellyDevice.log, endpoint);
if (!isValidNumber(current, 0, 10000)) {
matterbridgeDevice.log.error(`Error: current position not found on endpoint ${or}${endpoint.name}:${endpoint.number}${db} ${hk}WindowCovering${db}`);
matterbridgeDevice.log.error(`Error: current position not found on endpoint ${or}${endpoint.name}:${endpoint.number}${er}`);
return;
}
matterbridgeDevice.setAttribute(WindowCoveringCluster.id, 'targetPositionLiftPercent100ths', current, shellyDevice.log, endpoint);
Expand Down

0 comments on commit e19a408

Please sign in to comment.