Skip to content

Commit b563793

Browse files
committed
feat(ci): automated releases
1 parent da7aa7b commit b563793

File tree

10 files changed

+1813
-4233
lines changed

10 files changed

+1813
-4233
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = {
2929
'@typescript-eslint/explicit-function-return-type': 'off',
3030
'@typescript-eslint/no-non-null-assertion': 'off',
3131
'@typescript-eslint/camelcase': 'off',
32-
'@typescript-eslint/no-explicit-any': 'off'
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/explicit-module-boundary-types': 'off'
3334
},
3435
};

package-lock.json

Lines changed: 1583 additions & 4003 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"test-ci": "npm test -- --reporter mocha-junit-reporter",
1717
"watch": "npm test -- --watch --watch-extensions ts -R min --watch-files src",
1818
"build": "rm -rf dist && tsc",
19-
"lint": "eslint --fix-dry-run src/**/*.ts",
20-
"lint:fix": "eslint --fix src/**/*.ts"
19+
"lint": "eslint src/**.ts --max-warnings=0",
20+
"lint:fix": "eslint --fix src/**"
2121
},
2222
"repository": {
2323
"type": "git",
@@ -38,11 +38,9 @@
3838
]
3939
},
4040
"dependencies": {
41-
"@types/es6-promise": "^3.3.0",
42-
"@types/node": "^13.13.5",
43-
"axios": "^0.19.2",
44-
"moment": "^2.25.3",
45-
"query-string": "^6.12.1"
41+
"axios": "^0.21.0",
42+
"moment": "^2.29.1",
43+
"query-string": "^6.13.6"
4644
},
4745
"devDependencies": {
4846
"@semantic-release/changelog": "^5.0.1",
@@ -51,17 +49,18 @@
5149
"@semantic-release/github": "^7.1.1",
5250
"@semantic-release/npm": "^7.0.6",
5351
"@semantic-release/release-notes-generator": "^9.0.1",
54-
"@types/mocha": "^7.0.2",
55-
"@typescript-eslint/eslint-plugin": "^2.27.0",
56-
"@typescript-eslint/parser": "^2.27.0",
57-
"eslint": "^6.8.0",
58-
"eslint-config-prettier": "^6.10.1",
59-
"eslint-plugin-prettier": "^3.1.2",
60-
"mocha": "^7.1.2",
61-
"prettier": "^2.0.4",
62-
"ts-node": "^8.8.1",
63-
"typescript": "^3.8.3",
64-
"typescript-eslint": "0.0.1-alpha.0"
52+
"@types/mocha": "^8.0.3",
53+
"@types/es6-promise": "^3.3.0",
54+
"@types/node": "^14.14.6",
55+
"@typescript-eslint/eslint-plugin": "^4.6.0",
56+
"@typescript-eslint/parser": "^4.6.0",
57+
"eslint": "^7.12.1",
58+
"eslint-config-prettier": "^6.15.0",
59+
"eslint-plugin-prettier": "^3.1.4",
60+
"mocha": "^8.2.0",
61+
"prettier": "^2.1.2",
62+
"ts-node": "^9.0.0",
63+
"typescript": "^4.0.5"
6564
},
6665
"license": "MIT"
6766
}

src/client/models/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export { User } from './user'
2-
export { Puck } from './puck'
3-
export { Vent } from './vent'
4-
export { Model } from './model'
5-
export { Room, RoomAwayMode, OccupancyMode, PuckInactive } from './room'
6-
export { Structure, StructureHeatCoolMode, FlairMode } from './structure'
1+
export { User } from './user';
2+
export { Puck } from './puck';
3+
export { Vent } from './vent';
4+
export { Model } from './model';
5+
export { Room, RoomAwayMode, OccupancyMode, PuckInactive } from './room';
6+
export { Structure, StructureHeatCoolMode, FlairMode } from './structure';

src/client/models/puck.ts

Lines changed: 90 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,106 @@
1-
import {Model} from "./model";
1+
import {Model} from './model';
22

33
export class Puck extends Model {
44
public static type = 'pucks'
55

66
irSetupEnabled?: boolean;
7-
temperatureOffsetOverrideC: number = 0;
7+
temperatureOffsetOverrideC = 0;
88
features?: any;
9-
bluetoothTxPowerMw: number = 0;
10-
locked: boolean = false;
9+
bluetoothTxPowerMw = 0;
10+
locked = false;
1111
oauthAppAssignedAt?: Date;
12-
beaconIntervalMs: number = 0;
13-
irDownload: boolean = false;
14-
setpointBoundLow: number = 0;
15-
temperatureOffsetC: number = 0;
16-
isGateway: boolean = false;
17-
subGhzRadioTxPowerMw: number = 0;
18-
currentRssi: number = 0;
19-
puckDisplayColor: string = '';
20-
inactive: boolean = false;
21-
setpointBoundHigh: number = 0;
22-
demoMode: number = 0;
23-
displayNumber: string = '';
24-
currentTemperatureC: number = 0;
25-
humidityOffset: number = 0;
26-
reportingIntervalDs: number = 0;
27-
currentHumidity: number = 0;
28-
orientation: string = '';
29-
dropRate: number = 0;
12+
beaconIntervalMs = 0;
13+
irDownload = false;
14+
setpointBoundLow = 0;
15+
temperatureOffsetC = 0;
16+
isGateway = false;
17+
subGhzRadioTxPowerMw = 0;
18+
currentRssi = 0;
19+
puckDisplayColor = '';
20+
inactive = false;
21+
setpointBoundHigh = 0;
22+
demoMode = 0;
23+
displayNumber = '';
24+
currentTemperatureC = 0;
25+
humidityOffset = 0;
26+
reportingIntervalDs = 0;
27+
currentHumidity = 0;
28+
orientation = '';
29+
dropRate = 0;
3030
updatedAt: Date = new Date();
3131
createdAt: Date = new Date();
3232

33-
desiredTemperatureC: number = 0;
34-
firmwareVersionB: string = '';
35-
firmwareVersionS: string = '';
36-
rssi: number = 0;
37-
firmwareVersionW: string = '';
38-
currentRoomPressure: number = 0;
39-
systemVoltage: number = 0;
33+
desiredTemperatureC = 0;
34+
firmwareVersionB = '';
35+
firmwareVersionS = '';
36+
rssi = 0;
37+
firmwareVersionW = '';
38+
currentRoomPressure = 0;
39+
systemVoltage = 0;
4040

41-
public setCurrentReading(data: any) {
42-
// {
43-
// 'room-temperature-c': 22.32,
44-
// 'firmware-version-s': 135,
45-
// 'current-offset': -500,
46-
// 'die-temperature': 3777,
47-
// rssi: -56,
48-
// 'created-at': '2020-05-09T18:29:31.658576+00:00',
49-
// 'system-voltage': 3.41,
50-
// light: 515,
51-
// 'button-pushes': 0,
52-
// 'firmware-version-b': 1,
53-
// 'is-gateway': true,
54-
// 'desired-temperature-c': 21.12,
55-
// 'firmware-version-w': 126,
56-
// temperature: 2732,
57-
// humidity: 44,
58-
// 'rotary-encoded-clicks': 0,
59-
// 'room-pressure': 100.62975,
60-
// 'message-version': 0
61-
// },
62-
this.systemVoltage = data.attributes['system-voltage']
63-
this.currentTemperatureC = data.attributes['room-temperature-c']
64-
this.currentHumidity = data.attributes['humidity']
65-
this.firmwareVersionS = data.attributes['firmware-version-s']
66-
this.firmwareVersionB = data.attributes['firmware-version-b']
67-
this.firmwareVersionW = data.attributes['firmware-version-w']
68-
this.currentRoomPressure = data.attributes['room-pressure']
69-
this.rssi = data.attributes['rssi']
70-
this.desiredTemperatureC = data.attributes['desired-temperature-c']
71-
this.isGateway = data.attributes['is-gateway']
41+
public setCurrentReading(data: any):void {
42+
// {
43+
// 'room-temperature-c': 22.32,
44+
// 'firmware-version-s': 135,
45+
// 'current-offset': -500,
46+
// 'die-temperature': 3777,
47+
// rssi: -56,
48+
// 'created-at': '2020-05-09T18:29:31.658576+00:00',
49+
// 'system-voltage': 3.41,
50+
// light: 515,
51+
// 'button-pushes': 0,
52+
// 'firmware-version-b': 1,
53+
// 'is-gateway': true,
54+
// 'desired-temperature-c': 21.12,
55+
// 'firmware-version-w': 126,
56+
// temperature: 2732,
57+
// humidity: 44,
58+
// 'rotary-encoded-clicks': 0,
59+
// 'room-pressure': 100.62975,
60+
// 'message-version': 0
61+
// },
62+
this.systemVoltage = data.attributes['system-voltage'];
63+
this.currentTemperatureC = data.attributes['room-temperature-c'];
64+
this.currentHumidity = data.attributes.humidity;
65+
this.firmwareVersionS = data.attributes['firmware-version-s'];
66+
this.firmwareVersionB = data.attributes['firmware-version-b'];
67+
this.firmwareVersionW = data.attributes['firmware-version-w'];
68+
this.currentRoomPressure = data.attributes['room-pressure'];
69+
this.rssi = data.attributes.rssi;
70+
this.desiredTemperatureC = data.attributes['desired-temperature-c'];
71+
this.isGateway = data.attributes['is-gateway'];
7272
}
7373

7474
public fromJSON(data: any) : Puck {
75-
this.irSetupEnabled = data.attributes['ir-setup-enabled'];
76-
this.temperatureOffsetOverrideC = data.attributes['temperature-offset-override-c'] ? data.attributes['temperature-offset-override-c'] : 0;
77-
this.features = data.attributes['features'];
78-
this.bluetoothTxPowerMw = data.attributes['bluetooth-tx-power-mw'];
79-
this.locked = data.attributes['locked'];
80-
this.oauthAppAssignedAt = data.attributes['oauth-app-assigned-at'] ? new Date(data.attributes['oauth-app-assigned-at']) : undefined;
81-
this.beaconIntervalMs = data.attributes['beacon-interval-ms'];
82-
this.irDownload = data.attributes['ir-download'];
83-
this.name = data.attributes['name'];
84-
this.setpointBoundLow = data.attributes['setpoint-bound-low'];
85-
this.setpointBoundHigh = data.attributes['setpoint-bound-high'];
86-
this.temperatureOffsetC = data.attributes['temperature-offset-c'] ? data.attributes['temperature-offset-c'] : 0;
87-
this.isGateway = data.attributes['is-gateway'];
88-
this.subGhzRadioTxPowerMw = data.attributes['sub-ghz-radio-tx-power-mw'] ? data.attributes['sub-ghz-radio-tx-power-mw'] : 0;
89-
this.currentRssi = data.attributes['current-rssi'];
90-
this.puckDisplayColor = data.attributes['puck-display-color'];
91-
this.inactive = data.attributes['inactive'];
92-
this.demoMode = data.attributes['demo-mode'];
93-
this.displayNumber = data.attributes['display-number'];
94-
this.currentTemperatureC = data.attributes['current-temperature-c'];
95-
this.humidityOffset = data.attributes['humidity-offset'] ? data.attributes['humidity-offset'] : 0;
96-
this.reportingIntervalDs = data.attributes['reporting-interval-ds'];
97-
this.currentHumidity = data.attributes['current-humidity'];
98-
this.orientation = data.attributes['orientation'];
99-
this.dropRate = data.attributes['drop-rate'];
100-
this.createdAt = new Date(data.attributes['created-at']);
101-
this.updatedAt = new Date(data.attributes['updated-at']);
102-
this.id = data.id;
103-
return this;
75+
this.irSetupEnabled = data.attributes['ir-setup-enabled'];
76+
this.temperatureOffsetOverrideC = data.attributes['temperature-offset-override-c']
77+
? data.attributes['temperature-offset-override-c'] : 0;
78+
this.features = data.attributes.features;
79+
this.bluetoothTxPowerMw = data.attributes['bluetooth-tx-power-mw'];
80+
this.locked = data.attributes.locked;
81+
this.oauthAppAssignedAt = data.attributes['oauth-app-assigned-at'] ? new Date(data.attributes['oauth-app-assigned-at']) : undefined;
82+
this.beaconIntervalMs = data.attributes['beacon-interval-ms'];
83+
this.irDownload = data.attributes['ir-download'];
84+
this.name = data.attributes.name;
85+
this.setpointBoundLow = data.attributes['setpoint-bound-low'];
86+
this.setpointBoundHigh = data.attributes['setpoint-bound-high'];
87+
this.temperatureOffsetC = data.attributes['temperature-offset-c'] ? data.attributes['temperature-offset-c'] : 0;
88+
this.isGateway = data.attributes['is-gateway'];
89+
this.subGhzRadioTxPowerMw = data.attributes['sub-ghz-radio-tx-power-mw'] ? data.attributes['sub-ghz-radio-tx-power-mw'] : 0;
90+
this.currentRssi = data.attributes['current-rssi'];
91+
this.puckDisplayColor = data.attributes['puck-display-color'];
92+
this.inactive = data.attributes.inactive;
93+
this.demoMode = data.attributes['demo-mode'];
94+
this.displayNumber = data.attributes['display-number'];
95+
this.currentTemperatureC = data.attributes['current-temperature-c'];
96+
this.humidityOffset = data.attributes['humidity-offset'] ? data.attributes['humidity-offset'] : 0;
97+
this.reportingIntervalDs = data.attributes['reporting-interval-ds'];
98+
this.currentHumidity = data.attributes['current-humidity'];
99+
this.orientation = data.attributes.orientation;
100+
this.dropRate = data.attributes['drop-rate'];
101+
this.createdAt = new Date(data.attributes['created-at']);
102+
this.updatedAt = new Date(data.attributes['updated-at']);
103+
this.id = data.id;
104+
return this;
104105
}
105106
}

src/client/models/room.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Model} from "./model";
1+
import {Model} from './model';
22

33
export enum PuckInactive {
44
NotSetup = 'NotSetup',
@@ -20,25 +20,25 @@ export class Room extends Model {
2020
createdAt: Date = new Date();
2121
holdUntil?: Date;
2222
pucksInactive: PuckInactive = PuckInactive.NotSetup
23-
active: boolean = false;
23+
active = false;
2424
currentTemperatureC?: number;
25-
humidityAwayMax: number = 0;
26-
tempAwayMaxC: number = 0;
27-
tempAwayMinC: number = 0;
25+
humidityAwayMax = 0;
26+
tempAwayMaxC = 0;
27+
tempAwayMinC = 0;
2828
holdReason?: string;
2929
windows?: any;
30-
holdUntilScheduleEvent: boolean = false;
31-
airReturn: boolean = false;
32-
frozenPipePetProtect: boolean = false;
33-
setPointC: number = 0;
34-
humidityAwayMin: number = 0;
30+
holdUntilScheduleEvent = false;
31+
airReturn = false;
32+
frozenPipePetProtect = false;
33+
setPointC = 0;
34+
humidityAwayMin = 0;
3535
level?: number;
3636
currentHumidity?: number;
3737
stateUpdatedAt?: Date;
38-
preheatPrecool: boolean = false;
38+
preheatPrecool = false;
3939

4040
//Unknown
41-
roomType: string = '';
41+
roomType = '';
4242
setPointManual?: string;
4343
occupancyMode: OccupancyMode = OccupancyMode.FlairAuto;
4444
roomAwayMode: RoomAwayMode = RoomAwayMode.SmartAway;
@@ -56,33 +56,33 @@ export class Room extends Model {
5656
// }
5757

5858
public fromJSON(data: any): Room {
59-
this.name = data.attributes['name'];
60-
this.createdAt = new Date(data.attributes['created-at']);
61-
this.updatedAt = new Date(data.attributes['updated-at']);
62-
this.pucksInactive = data.attributes['pucks-inactive'];
63-
this.holdUntil = data.attributes['hold-until'] ? new Date(data.attributes['hold-until']) : undefined;
64-
this.roomType = data.attributes['room-type'];
65-
this.setPointManual = data.attributes['set-point-manual'] ? data.attributes['set-point-manual'] : undefined;
66-
this.active = data.attributes['active'];
67-
this.currentTemperatureC = data.attributes['current-temperature-c'] ? data.attributes['current-temperature-c'] : undefined;
68-
this.humidityAwayMax = data.attributes['humidity-away-max'];
69-
this.tempAwayMaxC = data.attributes['temp-away-max-c'];
70-
this.tempAwayMinC = data.attributes['temp-away-min-c'];
71-
this.holdReason = data.attributes['hold-reason'] ? data.attributes['hold-reason'] : undefined;
72-
this.windows = data.attributes['windows']
73-
this.holdUntilScheduleEvent = data.attributes['hold-until-schedule-event'];
74-
this.airReturn = data.attributes['air-return'];
75-
this.frozenPipePetProtect = data.attributes['frozen-pipe-pet-protect'];
76-
this.humidityAwayMin = data.attributes['humidity-away-min'];
77-
this.setPointC = data.attributes['set-point-c'];
78-
this.level = data.attributes['level'] ? data.attributes['level'] : undefined;
79-
this.currentHumidity = data.attributes['current-humidity'] ? data.attributes['current-humidity'] : undefined;
80-
this.stateUpdatedAt = data.attributes['state-updated-at'] ? new Date(data.attributes['state-updated-at']) : undefined;
81-
this.preheatPrecool = data.attributes['preheat-precool'];
82-
this.occupancyMode = data.attributes['occupancy-mode'];
83-
this.roomAwayMode = data.attributes['room-away-mode'];
59+
this.name = data.attributes.name;
60+
this.createdAt = new Date(data.attributes['created-at']);
61+
this.updatedAt = new Date(data.attributes['updated-at']);
62+
this.pucksInactive = data.attributes['pucks-inactive'];
63+
this.holdUntil = data.attributes['hold-until'] ? new Date(data.attributes['hold-until']) : undefined;
64+
this.roomType = data.attributes['room-type'];
65+
this.setPointManual = data.attributes['set-point-manual'] ? data.attributes['set-point-manual'] : undefined;
66+
this.active = data.attributes.active;
67+
this.currentTemperatureC = data.attributes['current-temperature-c'] ? data.attributes['current-temperature-c'] : undefined;
68+
this.humidityAwayMax = data.attributes['humidity-away-max'];
69+
this.tempAwayMaxC = data.attributes['temp-away-max-c'];
70+
this.tempAwayMinC = data.attributes['temp-away-min-c'];
71+
this.holdReason = data.attributes['hold-reason'] ? data.attributes['hold-reason'] : undefined;
72+
this.windows = data.attributes.windows;
73+
this.holdUntilScheduleEvent = data.attributes['hold-until-schedule-event'];
74+
this.airReturn = data.attributes['air-return'];
75+
this.frozenPipePetProtect = data.attributes['frozen-pipe-pet-protect'];
76+
this.humidityAwayMin = data.attributes['humidity-away-min'];
77+
this.setPointC = data.attributes['set-point-c'];
78+
this.level = data.attributes.level ? data.attributes.level : undefined;
79+
this.currentHumidity = data.attributes['current-humidity'] ? data.attributes['current-humidity'] : undefined;
80+
this.stateUpdatedAt = data.attributes['state-updated-at'] ? new Date(data.attributes['state-updated-at']) : undefined;
81+
this.preheatPrecool = data.attributes['preheat-precool'];
82+
this.occupancyMode = data.attributes['occupancy-mode'];
83+
this.roomAwayMode = data.attributes['room-away-mode'];
8484

85-
this.id = data.id;
86-
return this;
85+
this.id = data.id;
86+
return this;
8787
}
8888
}

0 commit comments

Comments
 (0)