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

Workaround IKEA bulbs freezing during a brightness & color transition #8637

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobrippling
Copy link
Contributor

WIP, see discussion in Koenkk/zigbee2mqtt#18574

@@ -3,6 +3,7 @@ import {Zcl} from 'zigbee-herdsman';
import * as libColor from '../lib/color';
import * as constants from '../lib/constants';
import * as exposes from '../lib/exposes';
import {unfreezeMechanisms, UnfreezeSupport} from '../lib/ikea';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like vendor-specific imports shouldn't be here and the logic from ../lib/ikea should be inlined into the ikea_bulb_unfreeze converter below

@@ -210,6 +211,7 @@ const definitions: DefinitionWithExtend[] = [
vendor: 'IKEA',
description: 'TRADFRI bulb B22, white spectrum, globe, opal, 1055 lm',
extend: [addCustomClusterManuSpecificIkeaUnknown(), ikeaLight({colorTemp: true}), m.identify()],
toZigbee: [tz.ikea_bulb_unfreeze],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could specify different unfreeze mechanisms in the future (as in the original code), but I only have this one bulb type to test with, so I'm just changing this for now

const frozenUtil = globalStore.getValue(this.entity, 'frozenUntil');
if (frozenUtil != null) {
if (Date.now() <= frozenUtil) {
console.log('Light is frozen, will attempt to unfreeze');
Copy link
Contributor Author

@bobrippling bobrippling Jan 18, 2025

Choose a reason for hiding this comment

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

This (and below) will be changed to a proper logger call

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.

1 participant