@@ -2,20 +2,7 @@ import fz from '../converters/fromZigbee';
2
2
import tz from '../converters/toZigbee' ;
3
3
import * as exposes from '../lib/exposes' ;
4
4
import * as reporting from '../lib/reporting' ;
5
- import { DefinitionWithExtend , Tz , Zh } from '../lib/types' ;
6
- import { assertString , getFromLookup , getOptions } from '../lib/utils' ;
7
-
8
- const tzLocal = {
9
- backwards_cover_state : {
10
- key : [ 'state' ] ,
11
- convertSet : async ( entity : Zh . Endpoint , key : string , value : number | string , meta : Tz . Meta ) => {
12
- const lookup = { open : 'downClose' , close : 'upOpen' , stop : 'stop' , on : 'downClose' , off : 'upOpen' } ;
13
- assertString ( value , key ) ;
14
- value = value . toLowerCase ( ) ;
15
- await entity . command ( 'closuresWindowCovering' , getFromLookup ( value , lookup ) , { } , getOptions ( meta . mapped , entity ) ) ;
16
- } ,
17
- } ,
18
- } ;
5
+ import { DefinitionWithExtend } from '../lib/types' ;
19
6
20
7
const e = exposes . presets ;
21
8
@@ -26,7 +13,7 @@ const definitions: DefinitionWithExtend[] = [
26
13
vendor : 'Smartwings' ,
27
14
description : 'Roller shade' ,
28
15
fromZigbee : [ fz . cover_position_tilt , fz . battery ] ,
29
- toZigbee : [ tzLocal . backwards_cover_state , tz . cover_position_tilt ] ,
16
+ toZigbee : [ tz . cover_state , tz . cover_position_tilt ] ,
30
17
meta : { battery : { dontDividePercentage : true } , coverInverted : true } ,
31
18
configure : async ( device , coordinatorEndpoint ) => {
32
19
const endpoint = device . getEndpoint ( 1 ) ;
0 commit comments