Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update legacy.ts #6316

Merged
merged 8 commits into from
Oct 21, 2023
Merged

Update legacy.ts #6316

merged 8 commits into from
Oct 21, 2023

Conversation

VoltickVL
Copy link
Contributor

_TZE200_5toc8efa fix settings

@@ -6712,15 +6728,16 @@ const toZigbee2 = {
convertSet: async (entity, key, value: any, meta) => {
if (['_TZE200_5toc8efa'].includes(meta.device.manufacturerName)) {
await sendDataPointValue(entity, dataPoints.moesHeatingSetpoint, value * 10);
} else {
if (value <= 5) value = Math.round(value*10);
await sendDataPointValue(entity, dataPoints.moesHeatingSetpoint, value);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the behaviour for all except _TZE200_5toc8efa, please revert this change.

convertSet: async (entity, key, value: any, meta) => {
if (['_TZE200_5toc8efa'].includes(meta.device.manufacturerName)) {
await sendDataPointValue(entity, dataPoints.moesDeadZoneTemp, value * 10);
}
await sendDataPointValue(entity, dataPoints.moesDeadZoneTemp, value);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an if else, otherwise you send the value twice, e.g.

            if (['_TZE200_5toc8efa'].includes(meta.device.manufacturerName)) {
                await sendDataPointValue(entity, dataPoints.moesDeadZoneTemp, value * 10);
            } else {
                await sendDataPointValue(entity, dataPoints.moesDeadZoneTemp, value);
            }

convertSet: async (entity, key, value: any, meta) => {
if (['_TZE200_5toc8efa'].includes(meta.device.manufacturerName)) {
await sendDataPointValue(entity, dataPoints.moesMinTempLimit, value * 10);
}
await sendDataPointValue(entity, dataPoints.moesMinTempLimit, value);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make if/else as described above

convertSet: async (entity, key, value: any, meta) => {
if (['_TZE200_5toc8efa'].includes(meta.device.manufacturerName)) {
await sendDataPointValue(entity, dataPoints.moesMaxTempLimit, value * 10);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make if/else as described above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx i edit legacy.ts

@Koenkk Koenkk merged commit d7ef1a8 into Koenkk:master Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants