Skip to content

Commit

Permalink
feat(ci): automated releases
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Nov 2, 2020
1 parent da7aa7b commit b563793
Show file tree
Hide file tree
Showing 10 changed files with 1,813 additions and 4,233 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off'
},
};
5,586 changes: 1,583 additions & 4,003 deletions package-lock.json

Large diffs are not rendered by default.

35 changes: 17 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"test-ci": "npm test -- --reporter mocha-junit-reporter",
"watch": "npm test -- --watch --watch-extensions ts -R min --watch-files src",
"build": "rm -rf dist && tsc",
"lint": "eslint --fix-dry-run src/**/*.ts",
"lint:fix": "eslint --fix src/**/*.ts"
"lint": "eslint src/**.ts --max-warnings=0",
"lint:fix": "eslint --fix src/**"
},
"repository": {
"type": "git",
Expand All @@ -38,11 +38,9 @@
]
},
"dependencies": {
"@types/es6-promise": "^3.3.0",
"@types/node": "^13.13.5",
"axios": "^0.19.2",
"moment": "^2.25.3",
"query-string": "^6.12.1"
"axios": "^0.21.0",
"moment": "^2.29.1",
"query-string": "^6.13.6"
},
"devDependencies": {
"@semantic-release/changelog": "^5.0.1",
Expand All @@ -51,17 +49,18 @@
"@semantic-release/github": "^7.1.1",
"@semantic-release/npm": "^7.0.6",
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/mocha": "^7.0.2",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"mocha": "^7.1.2",
"prettier": "^2.0.4",
"ts-node": "^8.8.1",
"typescript": "^3.8.3",
"typescript-eslint": "0.0.1-alpha.0"
"@types/mocha": "^8.0.3",
"@types/es6-promise": "^3.3.0",
"@types/node": "^14.14.6",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"eslint": "^7.12.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"mocha": "^8.2.0",
"prettier": "^2.1.2",
"ts-node": "^9.0.0",
"typescript": "^4.0.5"
},
"license": "MIT"
}
12 changes: 6 additions & 6 deletions src/client/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { User } from './user'
export { Puck } from './puck'
export { Vent } from './vent'
export { Model } from './model'
export { Room, RoomAwayMode, OccupancyMode, PuckInactive } from './room'
export { Structure, StructureHeatCoolMode, FlairMode } from './structure'
export { User } from './user';
export { Puck } from './puck';
export { Vent } from './vent';
export { Model } from './model';
export { Room, RoomAwayMode, OccupancyMode, PuckInactive } from './room';
export { Structure, StructureHeatCoolMode, FlairMode } from './structure';
179 changes: 90 additions & 89 deletions src/client/models/puck.ts
Original file line number Diff line number Diff line change
@@ -1,105 +1,106 @@
import {Model} from "./model";
import {Model} from './model';

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

irSetupEnabled?: boolean;
temperatureOffsetOverrideC: number = 0;
temperatureOffsetOverrideC = 0;
features?: any;
bluetoothTxPowerMw: number = 0;
locked: boolean = false;
bluetoothTxPowerMw = 0;
locked = false;
oauthAppAssignedAt?: Date;
beaconIntervalMs: number = 0;
irDownload: boolean = false;
setpointBoundLow: number = 0;
temperatureOffsetC: number = 0;
isGateway: boolean = false;
subGhzRadioTxPowerMw: number = 0;
currentRssi: number = 0;
puckDisplayColor: string = '';
inactive: boolean = false;
setpointBoundHigh: number = 0;
demoMode: number = 0;
displayNumber: string = '';
currentTemperatureC: number = 0;
humidityOffset: number = 0;
reportingIntervalDs: number = 0;
currentHumidity: number = 0;
orientation: string = '';
dropRate: number = 0;
beaconIntervalMs = 0;
irDownload = false;
setpointBoundLow = 0;
temperatureOffsetC = 0;
isGateway = false;
subGhzRadioTxPowerMw = 0;
currentRssi = 0;
puckDisplayColor = '';
inactive = false;
setpointBoundHigh = 0;
demoMode = 0;
displayNumber = '';
currentTemperatureC = 0;
humidityOffset = 0;
reportingIntervalDs = 0;
currentHumidity = 0;
orientation = '';
dropRate = 0;
updatedAt: Date = new Date();
createdAt: Date = new Date();

desiredTemperatureC: number = 0;
firmwareVersionB: string = '';
firmwareVersionS: string = '';
rssi: number = 0;
firmwareVersionW: string = '';
currentRoomPressure: number = 0;
systemVoltage: number = 0;
desiredTemperatureC = 0;
firmwareVersionB = '';
firmwareVersionS = '';
rssi = 0;
firmwareVersionW = '';
currentRoomPressure = 0;
systemVoltage = 0;

public setCurrentReading(data: any) {
// {
// 'room-temperature-c': 22.32,
// 'firmware-version-s': 135,
// 'current-offset': -500,
// 'die-temperature': 3777,
// rssi: -56,
// 'created-at': '2020-05-09T18:29:31.658576+00:00',
// 'system-voltage': 3.41,
// light: 515,
// 'button-pushes': 0,
// 'firmware-version-b': 1,
// 'is-gateway': true,
// 'desired-temperature-c': 21.12,
// 'firmware-version-w': 126,
// temperature: 2732,
// humidity: 44,
// 'rotary-encoded-clicks': 0,
// 'room-pressure': 100.62975,
// 'message-version': 0
// },
this.systemVoltage = data.attributes['system-voltage']
this.currentTemperatureC = data.attributes['room-temperature-c']
this.currentHumidity = data.attributes['humidity']
this.firmwareVersionS = data.attributes['firmware-version-s']
this.firmwareVersionB = data.attributes['firmware-version-b']
this.firmwareVersionW = data.attributes['firmware-version-w']
this.currentRoomPressure = data.attributes['room-pressure']
this.rssi = data.attributes['rssi']
this.desiredTemperatureC = data.attributes['desired-temperature-c']
this.isGateway = data.attributes['is-gateway']
public setCurrentReading(data: any):void {
// {
// 'room-temperature-c': 22.32,
// 'firmware-version-s': 135,
// 'current-offset': -500,
// 'die-temperature': 3777,
// rssi: -56,
// 'created-at': '2020-05-09T18:29:31.658576+00:00',
// 'system-voltage': 3.41,
// light: 515,
// 'button-pushes': 0,
// 'firmware-version-b': 1,
// 'is-gateway': true,
// 'desired-temperature-c': 21.12,
// 'firmware-version-w': 126,
// temperature: 2732,
// humidity: 44,
// 'rotary-encoded-clicks': 0,
// 'room-pressure': 100.62975,
// 'message-version': 0
// },
this.systemVoltage = data.attributes['system-voltage'];
this.currentTemperatureC = data.attributes['room-temperature-c'];
this.currentHumidity = data.attributes.humidity;
this.firmwareVersionS = data.attributes['firmware-version-s'];
this.firmwareVersionB = data.attributes['firmware-version-b'];
this.firmwareVersionW = data.attributes['firmware-version-w'];
this.currentRoomPressure = data.attributes['room-pressure'];
this.rssi = data.attributes.rssi;
this.desiredTemperatureC = data.attributes['desired-temperature-c'];
this.isGateway = data.attributes['is-gateway'];
}

public fromJSON(data: any) : Puck {
this.irSetupEnabled = data.attributes['ir-setup-enabled'];
this.temperatureOffsetOverrideC = data.attributes['temperature-offset-override-c'] ? data.attributes['temperature-offset-override-c'] : 0;
this.features = data.attributes['features'];
this.bluetoothTxPowerMw = data.attributes['bluetooth-tx-power-mw'];
this.locked = data.attributes['locked'];
this.oauthAppAssignedAt = data.attributes['oauth-app-assigned-at'] ? new Date(data.attributes['oauth-app-assigned-at']) : undefined;
this.beaconIntervalMs = data.attributes['beacon-interval-ms'];
this.irDownload = data.attributes['ir-download'];
this.name = data.attributes['name'];
this.setpointBoundLow = data.attributes['setpoint-bound-low'];
this.setpointBoundHigh = data.attributes['setpoint-bound-high'];
this.temperatureOffsetC = data.attributes['temperature-offset-c'] ? data.attributes['temperature-offset-c'] : 0;
this.isGateway = data.attributes['is-gateway'];
this.subGhzRadioTxPowerMw = data.attributes['sub-ghz-radio-tx-power-mw'] ? data.attributes['sub-ghz-radio-tx-power-mw'] : 0;
this.currentRssi = data.attributes['current-rssi'];
this.puckDisplayColor = data.attributes['puck-display-color'];
this.inactive = data.attributes['inactive'];
this.demoMode = data.attributes['demo-mode'];
this.displayNumber = data.attributes['display-number'];
this.currentTemperatureC = data.attributes['current-temperature-c'];
this.humidityOffset = data.attributes['humidity-offset'] ? data.attributes['humidity-offset'] : 0;
this.reportingIntervalDs = data.attributes['reporting-interval-ds'];
this.currentHumidity = data.attributes['current-humidity'];
this.orientation = data.attributes['orientation'];
this.dropRate = data.attributes['drop-rate'];
this.createdAt = new Date(data.attributes['created-at']);
this.updatedAt = new Date(data.attributes['updated-at']);
this.id = data.id;
return this;
this.irSetupEnabled = data.attributes['ir-setup-enabled'];
this.temperatureOffsetOverrideC = data.attributes['temperature-offset-override-c']
? data.attributes['temperature-offset-override-c'] : 0;
this.features = data.attributes.features;
this.bluetoothTxPowerMw = data.attributes['bluetooth-tx-power-mw'];
this.locked = data.attributes.locked;
this.oauthAppAssignedAt = data.attributes['oauth-app-assigned-at'] ? new Date(data.attributes['oauth-app-assigned-at']) : undefined;
this.beaconIntervalMs = data.attributes['beacon-interval-ms'];
this.irDownload = data.attributes['ir-download'];
this.name = data.attributes.name;
this.setpointBoundLow = data.attributes['setpoint-bound-low'];
this.setpointBoundHigh = data.attributes['setpoint-bound-high'];
this.temperatureOffsetC = data.attributes['temperature-offset-c'] ? data.attributes['temperature-offset-c'] : 0;
this.isGateway = data.attributes['is-gateway'];
this.subGhzRadioTxPowerMw = data.attributes['sub-ghz-radio-tx-power-mw'] ? data.attributes['sub-ghz-radio-tx-power-mw'] : 0;
this.currentRssi = data.attributes['current-rssi'];
this.puckDisplayColor = data.attributes['puck-display-color'];
this.inactive = data.attributes.inactive;
this.demoMode = data.attributes['demo-mode'];
this.displayNumber = data.attributes['display-number'];
this.currentTemperatureC = data.attributes['current-temperature-c'];
this.humidityOffset = data.attributes['humidity-offset'] ? data.attributes['humidity-offset'] : 0;
this.reportingIntervalDs = data.attributes['reporting-interval-ds'];
this.currentHumidity = data.attributes['current-humidity'];
this.orientation = data.attributes.orientation;
this.dropRate = data.attributes['drop-rate'];
this.createdAt = new Date(data.attributes['created-at']);
this.updatedAt = new Date(data.attributes['updated-at']);
this.id = data.id;
return this;
}
}
78 changes: 39 additions & 39 deletions src/client/models/room.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Model} from "./model";
import {Model} from './model';

export enum PuckInactive {
NotSetup = 'NotSetup',
Expand All @@ -20,25 +20,25 @@ export class Room extends Model {
createdAt: Date = new Date();
holdUntil?: Date;
pucksInactive: PuckInactive = PuckInactive.NotSetup
active: boolean = false;
active = false;
currentTemperatureC?: number;
humidityAwayMax: number = 0;
tempAwayMaxC: number = 0;
tempAwayMinC: number = 0;
humidityAwayMax = 0;
tempAwayMaxC = 0;
tempAwayMinC = 0;
holdReason?: string;
windows?: any;
holdUntilScheduleEvent: boolean = false;
airReturn: boolean = false;
frozenPipePetProtect: boolean = false;
setPointC: number = 0;
humidityAwayMin: number = 0;
holdUntilScheduleEvent = false;
airReturn = false;
frozenPipePetProtect = false;
setPointC = 0;
humidityAwayMin = 0;
level?: number;
currentHumidity?: number;
stateUpdatedAt?: Date;
preheatPrecool: boolean = false;
preheatPrecool = false;

//Unknown
roomType: string = '';
roomType = '';
setPointManual?: string;
occupancyMode: OccupancyMode = OccupancyMode.FlairAuto;
roomAwayMode: RoomAwayMode = RoomAwayMode.SmartAway;
Expand All @@ -56,33 +56,33 @@ export class Room extends Model {
// }

public fromJSON(data: any): Room {
this.name = data.attributes['name'];
this.createdAt = new Date(data.attributes['created-at']);
this.updatedAt = new Date(data.attributes['updated-at']);
this.pucksInactive = data.attributes['pucks-inactive'];
this.holdUntil = data.attributes['hold-until'] ? new Date(data.attributes['hold-until']) : undefined;
this.roomType = data.attributes['room-type'];
this.setPointManual = data.attributes['set-point-manual'] ? data.attributes['set-point-manual'] : undefined;
this.active = data.attributes['active'];
this.currentTemperatureC = data.attributes['current-temperature-c'] ? data.attributes['current-temperature-c'] : undefined;
this.humidityAwayMax = data.attributes['humidity-away-max'];
this.tempAwayMaxC = data.attributes['temp-away-max-c'];
this.tempAwayMinC = data.attributes['temp-away-min-c'];
this.holdReason = data.attributes['hold-reason'] ? data.attributes['hold-reason'] : undefined;
this.windows = data.attributes['windows']
this.holdUntilScheduleEvent = data.attributes['hold-until-schedule-event'];
this.airReturn = data.attributes['air-return'];
this.frozenPipePetProtect = data.attributes['frozen-pipe-pet-protect'];
this.humidityAwayMin = data.attributes['humidity-away-min'];
this.setPointC = data.attributes['set-point-c'];
this.level = data.attributes['level'] ? data.attributes['level'] : undefined;
this.currentHumidity = data.attributes['current-humidity'] ? data.attributes['current-humidity'] : undefined;
this.stateUpdatedAt = data.attributes['state-updated-at'] ? new Date(data.attributes['state-updated-at']) : undefined;
this.preheatPrecool = data.attributes['preheat-precool'];
this.occupancyMode = data.attributes['occupancy-mode'];
this.roomAwayMode = data.attributes['room-away-mode'];
this.name = data.attributes.name;
this.createdAt = new Date(data.attributes['created-at']);
this.updatedAt = new Date(data.attributes['updated-at']);
this.pucksInactive = data.attributes['pucks-inactive'];
this.holdUntil = data.attributes['hold-until'] ? new Date(data.attributes['hold-until']) : undefined;
this.roomType = data.attributes['room-type'];
this.setPointManual = data.attributes['set-point-manual'] ? data.attributes['set-point-manual'] : undefined;
this.active = data.attributes.active;
this.currentTemperatureC = data.attributes['current-temperature-c'] ? data.attributes['current-temperature-c'] : undefined;
this.humidityAwayMax = data.attributes['humidity-away-max'];
this.tempAwayMaxC = data.attributes['temp-away-max-c'];
this.tempAwayMinC = data.attributes['temp-away-min-c'];
this.holdReason = data.attributes['hold-reason'] ? data.attributes['hold-reason'] : undefined;
this.windows = data.attributes.windows;
this.holdUntilScheduleEvent = data.attributes['hold-until-schedule-event'];
this.airReturn = data.attributes['air-return'];
this.frozenPipePetProtect = data.attributes['frozen-pipe-pet-protect'];
this.humidityAwayMin = data.attributes['humidity-away-min'];
this.setPointC = data.attributes['set-point-c'];
this.level = data.attributes.level ? data.attributes.level : undefined;
this.currentHumidity = data.attributes['current-humidity'] ? data.attributes['current-humidity'] : undefined;
this.stateUpdatedAt = data.attributes['state-updated-at'] ? new Date(data.attributes['state-updated-at']) : undefined;
this.preheatPrecool = data.attributes['preheat-precool'];
this.occupancyMode = data.attributes['occupancy-mode'];
this.roomAwayMode = data.attributes['room-away-mode'];

this.id = data.id;
return this;
this.id = data.id;
return this;
}
}
Loading

0 comments on commit b563793

Please sign in to comment.