homebridge-bomgovau-v2 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -75,7 +75,7 @@ class BOMgovauAccessory {
75
75
 
76
76
  // Load community types and FakeGato - instance local, not global
77
77
  /** @type {Object} */
78
- this.CommunityTypes = require("hap-nodejs-community-types")(api);
78
+ this.CommunityTypes = require("hap-nodejs-community-types")(api.hap);
79
79
  /** @type {Function} */
80
80
  this.FakeGatoHistoryService = require("fakegato-history")(api);
81
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-bomgovau-v2",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Makes BOM.gov.au data available in your Homebridge(Homekit) setup",
5
5
  "homepage": "https://github.com/pcoombe/homebridge-BOMgovau",
6
6
  "license": "Apache-2",
@@ -67,7 +67,8 @@ Module._load = function(request, parent, isMain) {
67
67
  return { Service, Characteristic };
68
68
  }
69
69
  if (request === "hap-nodejs-community-types") {
70
- return () => ({ AtmosphericPressureLevel: "AtmosphericPressureLevel" });
70
+ // The module now receives api.hap, so we need to handle it properly
71
+ return (hap) => ({ AtmosphericPressureLevel: "AtmosphericPressureLevel" });
71
72
  }
72
73
  if (request === "fakegato-history") {
73
74
  return () => historyService;
@@ -81,6 +82,7 @@ function characteristicValue(service, type) {
81
82
 
82
83
  async function main() {
83
84
  const api = {
85
+ hap: { Service, Characteristic, uuid: () => "mock-uuid" },
84
86
  registerAccessory(pluginName, accessoryName, accessoryClass) {
85
87
  this.accessoryClass = accessoryClass;
86
88
  this.accessoryName = accessoryName;