From 4948aa67467d787acb287cc139a0442464f05a7d Mon Sep 17 00:00:00 2001
From: Marin Karamihalev <marin.karamihalev@iopsys.eu>
Date: Tue, 15 Dec 2020 14:26:30 +0100
Subject: [PATCH] Fixed publishing mistake and README error

---
 README.md    | 20 ++++++++------------
 package.json |  7 ++++---
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/README.md b/README.md
index e898200..6884c4c 100644
--- a/README.md
+++ b/README.md
@@ -10,25 +10,21 @@ Helper library for easy usp communication using mqtt over tcp or ws.
 # Usage
 
 ```javascript
-const connect = require("usp-js").default;
-
-const options = {
-  host: "192.168.1.1",
-  port: 9001,
-  protocol: "mqtt",
-  username: "admin",
-  password: "admin",
-};
+const connect = require("usp-js").default
 
 const run = async () => {
   // Connect to device
-  const device = await connect(options);
+  const device = await connect({
+    host: "192.168.1.1",
+    username: "admin",
+    password: "admin"
+  });
 
   // Get property
-  await get("Device.WiFi.").then(console.log);
+  await device.get("Device.WiFi.").then(console.log);
 
   // Disconnect
-  await disconnect(session);
+  await device.disconnect();
 };
 
 run();
diff --git a/package.json b/package.json
index a84d595..32a30dc 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,14 @@
 {
   "name": "usp-js",
-  "version": "0.0.1",
+  "version": "0.0.2",
   "description": "Helper library for easy usp communication using mqtt over tcp or ws.",
   "main": "build/index.js",
   "scripts": {
     "dev": "tsc -w --outDir build",
     "build": "tsc --outDir build",
     "test": "npm run build && mocha tests/unit",
-    "test:device": "npm run build && mocha tests/integration"
+    "test:device": "npm run build && mocha tests/integration",
+    "prepublish": "npm run build"
   },
   "keywords": [],
   "author": "Marin Karamihalev <marin.karamihalev@iopsys.eu> (http://iopsys.eu)",
@@ -22,5 +23,5 @@
     "typescript": "^4.0.5"
   },
   "type": "commonjs",
-  "types": "src/types.d.ts"
+  "types": "build/index.d.ts"
 }
-- 
GitLab