-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
base: master
Are you sure you want to change the base?
Conversation
a854d5b
to
da0194d
Compare
da0194d
to
a5f1cfe
Compare
@@ -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'; |
There was a problem hiding this comment.
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], |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
WIP, see discussion in Koenkk/zigbee2mqtt#18574