Skip to content

Commit

Permalink
fix: Revert "Invert direction for Smartwings shades" (#8736)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored Feb 4, 2025
1 parent dded1fa commit a6f234d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/devices/smartwings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@ import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
import * as exposes from '../lib/exposes';
import * as reporting from '../lib/reporting';
import {DefinitionWithExtend, Tz, Zh} from '../lib/types';
import {assertString, getFromLookup, getOptions} from '../lib/utils';

const tzLocal = {
backwards_cover_state: {
key: ['state'],
convertSet: async (entity: Zh.Endpoint, key: string, value: number | string, meta: Tz.Meta) => {
const lookup = {open: 'downClose', close: 'upOpen', stop: 'stop', on: 'downClose', off: 'upOpen'};
assertString(value, key);
value = value.toLowerCase();
await entity.command('closuresWindowCovering', getFromLookup(value, lookup), {}, getOptions(meta.mapped, entity));
},
},
};
import {DefinitionWithExtend} from '../lib/types';

const e = exposes.presets;

Expand All @@ -26,7 +13,7 @@ const definitions: DefinitionWithExtend[] = [
vendor: 'Smartwings',
description: 'Roller shade',
fromZigbee: [fz.cover_position_tilt, fz.battery],
toZigbee: [tzLocal.backwards_cover_state, tz.cover_position_tilt],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
meta: {battery: {dontDividePercentage: true}, coverInverted: true},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
Expand Down

0 comments on commit a6f234d

Please sign in to comment.