simbaja / gehome

Python SDK for GE smart appliances
MIT License
42 stars 29 forks source link

Bug In Dishwasher ErdUserSettingConverter #46

Closed NickWaterton closed 1 year ago

NickWaterton commented 1 year ago

Hi!

I found a bug in ErdUserSettingConverter for Dishwashers

In gehomesdk.erd.values.dishwasher.erd_user_setting_converter.py the value for cycle_mode is defined as:

return ErdUserSetting(
                bottle_jet = UserSetting(i & 1),
                cycle_mode = UserCycleSetting(i & 14 >> 1),
                sabbath = UserSetting((i & 64) >> 6),
                presoak = UserSetting((i & 256) >> 8),
                lock_control = UserSetting((i & 512) >> 9),
                dry_option = UserDryOptionSetting((i & 3072) >> 10),
                wash_temp = UserWashTempSetting((i & 12288) >> 12),
                delay_hours = (i & 983040) >> 16,
                wash_zone = UserWashZoneSetting((i & 3145728) >> 20),
                sound = UserSetting((i & 8388608) >> 23),
                raw_value=value
            )

cycle_mode is missing the required brackets, it should be:

return ErdUserSetting(
                bottle_jet = UserSetting(i & 1),
                cycle_mode = UserCycleSetting((i & 14) >> 1),   #missing brackets added by Nick
                sabbath = UserSetting((i & 64) >> 6),
                presoak = UserSetting((i & 256) >> 8),
                lock_control = UserSetting((i & 512) >> 9),
                dry_option = UserDryOptionSetting((i & 3072) >> 10),
                wash_temp = UserWashTempSetting((i & 12288) >> 12),
                delay_hours = (i & 983040) >> 16,
                wash_zone = UserWashZoneSetting((i & 3145728) >> 20),
                sound = UserSetting((i & 8388608) >> 23),
                raw_value=value
            )

Thanks for the great library!

simbaja commented 1 year ago

Saw your other comments, thanks for looking at this! This is indeed a bug :). Based on the other thread, it looks like you've made a bunch of enhancements, so hopefully you can put them in a PR, really appreciate the help here!