Skip to content

Commit

Permalink
feat(ignore): Support battery for SOMFY-1241752 (#6026)
Browse files Browse the repository at this point in the history
* Initial support for SOMFY blind motors

* Update somfy.ts

* Added support for battery level reporting

* Delete somfy.js

* Update somfy.ts

---------

Co-authored-by: Dan Bennett <@nonodename.com>
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
nonodename and Koenkk authored Jul 31, 2023
1 parent 993b030 commit 582536f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/devices/somfy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Definition} from '../lib/types';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
import * as exposes from '../lib/exposes';
import * as reporting from '../lib/reporting';

const e = exposes.presets;

Expand All @@ -13,7 +14,12 @@ const definitions: Definition[] = [
description: 'Blinds from vendors using this roller',
fromZigbee: [fz.battery, fz.power_source, fz.cover_position_tilt],
toZigbee: [tz.cover_state, tz.cover_position_tilt],
exposes: [e.cover_position()],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(232);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
await reporting.batteryPercentageRemaining(endpoint);
},
exposes: [e.cover_position(), e.battery()],
},
];

Expand Down

0 comments on commit 582536f

Please sign in to comment.