Skip to content

Commit

Permalink
fix: Fix type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 7, 2023
1 parent fceae62 commit aa5ad41
Show file tree
Hide file tree
Showing 236 changed files with 927 additions and 693 deletions.
1 change: 1 addition & 0 deletions src/devices/ITCommander.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import fz from '../converters/fromZigbee';
import * as exposes from '../lib/exposes';
const e = exposes.presets;
Expand Down
1 change: 1 addition & 0 deletions src/devices/acova.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
Expand Down
1 change: 1 addition & 0 deletions src/devices/acuity_brands_lighting.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';

const definitions: Definition[] = [
Expand Down
3 changes: 2 additions & 1 deletion src/devices/adeo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition, Fz} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import * as reporting from '../lib/reporting';
Expand All @@ -18,7 +19,7 @@ const fzLocal = {
battery_low: (zoneStatus & 1<<3) > 0,
};
},
} as fz.Converter,
} as Fz.Converter,
};

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/adurosmart.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
Expand Down
1 change: 1 addition & 0 deletions src/devices/aeotec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import fz from '../converters/fromZigbee';

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/airam.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import * as legacy from '../lib/legacy';
Expand Down
1 change: 1 addition & 0 deletions src/devices/ajax_online.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';
import * as tuya from '../lib/tuya';

Expand Down
1 change: 1 addition & 0 deletions src/devices/akuvox.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import * as reporting from '../lib/reporting';
Expand Down
1 change: 1 addition & 0 deletions src/devices/alchemy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/aldi.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
const e = exposes.presets;
Expand Down
1 change: 1 addition & 0 deletions src/devices/alecto.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import * as legacy from '../lib/legacy';
const fz = {...require('../converters/fromZigbee'), legacy: legacy.fromZigbee};
Expand Down
1 change: 1 addition & 0 deletions src/devices/anchor.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as reporting from '../lib/reporting';
import extend from '../lib/extend';

Expand Down
9 changes: 5 additions & 4 deletions src/devices/atlantic.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition, KeyValue, Tz} from '../lib/types';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
import * as exposes from '../lib/exposes';
Expand All @@ -23,7 +24,7 @@ const tzLocal = {
await entity.write('hvacFanCtrl', {0x1000: {value: value ? 1 : 0, type: 0x10}}, {manufacturerCode: 0x125b});
return {state: {quiet_fan: value}};
},
} as tz.Converter,
} as Tz.Converter,
ac_louver_position: {
key: ['ac_louver_position'],
convertSet: async (entity, key, value, meta) => {
Expand All @@ -33,7 +34,7 @@ const tzLocal = {
await entity.write('hvacThermostat', {0x4273: {value: index, type: 0x30}}, {manufacturerCode: 0x125b});
return {state: {ac_louver_position: value}};
},
} as tz.Converter,
} as Tz.Converter,
preset: {
key: ['preset'],
convertSet: async (entity, key, value, meta) => {
Expand All @@ -50,7 +51,7 @@ const tzLocal = {

return {state: {preset: value}};
},
} as tz.Converter,
} as Tz.Converter,
swingMode: {
key: ['swing_mode'],
convertSet: async (entity, key, value, meta) => {
Expand All @@ -60,7 +61,7 @@ const tzLocal = {
await entity.write('hvacThermostat', {0x4274: {value: value === 'on' ? 1 : 0, type: 0x10}}, {manufacturerCode: 0x125b});
return {state: {swing_mode: value}};
},
} as tz.Converter,
} as Tz.Converter,
};

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/atsmart.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import * as reporting from '../lib/reporting';
import extend from '../lib/extend';
Expand Down
1 change: 1 addition & 0 deletions src/devices/aubess.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as zosung from '../lib/zosung';
const fzZosung = zosung.fzZosung;
const tzZosung = zosung.tzZosung;
Expand Down
11 changes: 6 additions & 5 deletions src/devices/aurora_lighting.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Configure, Definition, Fz, OnEvent, Tz, Zh} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
Expand All @@ -18,7 +19,7 @@ const tzLocal = {
await endpoint.command('genOnOff', state, {});
return {state: {backlight_led: state.toUpperCase()}};
},
} as tz.Converter,
} as Tz.Converter,
backlight_brightness: {
key: ['brightness'],
options: [exposes.options.transition()],
Expand All @@ -29,10 +30,10 @@ const tzLocal = {
convertGet: async (entity, key, meta) => {
await entity.read('genLevelCtrl', ['currentLevel']);
},
} as tz.Converter,
} as Tz.Converter,
};

const disableBatteryRotaryDimmerReporting = async (endpoint: zh.Endpoint) => {
const disableBatteryRotaryDimmerReporting = async (endpoint: Zh.Endpoint) => {
// The default is for the device to also report the on/off and
// brightness at the same time as sending on/off and step commands.
// Disable the reporting by setting the max interval to 0xFFFF.
Expand All @@ -41,8 +42,8 @@ const disableBatteryRotaryDimmerReporting = async (endpoint: zh.Endpoint) => {
};

const batteryRotaryDimmer = (...endpointsIds: number[]) => ({
fromZigbee: [fz.battery, fz.command_on, fz.command_off, fz.command_step, fz.command_step_color_temperature] as fz.Converter[],
toZigbee: [] as tz.Converter[],
fromZigbee: [fz.battery, fz.command_on, fz.command_off, fz.command_step, fz.command_step_color_temperature] as Fz.Converter[],
toZigbee: [] as Tz.Converter[],
exposes: [e.battery(), e.action([
'on', 'off', 'brightness_step_up', 'brightness_step_down', 'color_temperature_step_up', 'color_temperature_step_down'])],
configure: (async (device, coordinatorEndpoint, logger) => {
Expand Down
1 change: 1 addition & 0 deletions src/devices/automaton.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as reporting from '../lib/reporting';
import * as tuya from '../lib/tuya';

Expand Down
7 changes: 4 additions & 3 deletions src/devices/awox.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition, Fz} from '../lib/types';
import extend from '../lib/extend';
import fz from '../converters/fromZigbee';
import * as exposes from '../lib/exposes';
Expand Down Expand Up @@ -35,7 +36,7 @@ const fzLocal = {
};
}
},
} as fz.Converter,
} as Fz.Converter,
refreshColored: {
cluster: 'lightingColorCtrl',
type: ['commandMoveHue'],
Expand All @@ -46,7 +47,7 @@ const fzLocal = {
};
}
},
} as fz.Converter,
} as Fz.Converter,
refresh: {
cluster: 'genLevelCtrl',
type: ['raw'],
Expand All @@ -57,7 +58,7 @@ const fzLocal = {
};
}
},
} as fz.Converter,
} as Fz.Converter,
};

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/axis.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
Expand Down
1 change: 1 addition & 0 deletions src/devices/bankamp.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/bega.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';

const definitions: Definition[] = [
Expand Down
1 change: 1 addition & 0 deletions src/devices/belkin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import extend from '../lib/extend';

const definitions: Definition[] = [
Expand Down
5 changes: 3 additions & 2 deletions src/devices/bitron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import extend from '../lib/extend';
const e = exposes.presets;
const ea = exposes.access;
import {Zcl} from 'zigbee-herdsman';
import {KeyValueAny, Fz, Tz, Definition} from '../lib/types';

const manufacturerOptions = {manufacturerCode: Zcl.ManufacturerCode._4_NOKS};

Expand All @@ -30,7 +31,7 @@ const bitron = {

return result;
},
} as fz.Converter,
} as Fz.Converter,
},
tz: {
thermostat_hysteresis: {
Expand All @@ -52,7 +53,7 @@ const bitron = {
convertGet: async (entity, key, meta) => {
await entity.read('hvacThermostat', ['fourNoksHysteresisHigh', 'fourNoksHysteresisLow'], manufacturerOptions);
},
} as tz.Converter,
} as Tz.Converter,
},
};

Expand Down
1 change: 1 addition & 0 deletions src/devices/blaupunkt.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import fz from '../converters/fromZigbee';
import tz from '../converters/toZigbee';
Expand Down
1 change: 1 addition & 0 deletions src/devices/blitzwolf.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {Definition} from '../lib/types';
import * as exposes from '../lib/exposes';
import * as legacy from '../lib/legacy';
import tz from '../converters/toZigbee';
Expand Down
Loading

0 comments on commit aa5ad41

Please sign in to comment.