Skip to content

Commit

Permalink
Added error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunoo committed Aug 27, 2020
1 parent 8249128 commit ff31183
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 44 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@

This plugin allows you to send 433MHz RF commands via HomeKit. I had no luck getting anything other than rpi-rf to communicate with my hardware. There are other plugins though, try those if this doesn't work for you.

## Manual Pre Install Steps

The included preinstall script should handle these for you, they are included for completeness.

1. Install pip using `sudo apt install python3-dev python3-pip`.
2. Install rpi-rf using `sudo pip3 install rpi-rf`.

## Installation

1. Install Homebridge using the [official instructions](https://github.com/homebridge/homebridge/wiki).
2. Install this plugin using `sudo npm install -g homebridge-rpi-rf-switch --unsafe-perm`.
3. Update your configuration file. See configuration sample below.
2. Install pip using `sudo apt install python3-dev python3-pip`.
3. Install rpi-rf using `sudo pip3 install rpi-rf`.
4. Install this plugin using `sudo npm install -g homebridge-rpi-rf-switch --unsafe-perm`.
5. Update your configuration file. See configuration sample below.

### Configuration

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"format": "markdownlint --fix *.md",
"lint": "eslint src/*.ts --fix",
"lint-check": "eslint src/*.ts",
"preinstall": "node preinstall.js",
"prepare": "npm run build",
"prepublishOnly": "npm run lint-check",
"postpublish": "npm run clean",
Expand Down
32 changes: 0 additions & 32 deletions preinstall.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ class RfSwitchPlatform implements DynamicPlatformPlugin {
try {
this.rfDevice = python.createSync(rpiRf, 'RFDevice', gpio, 1, null, repeat, 24);
} catch (ex) {
this.log.error('Error starting rpi-rf. Please make sure it you\'ve followed the ' +
'installation instructions on the project\'s page. ' + ex);
this.log.error('Error starting rpi-rf, please make sure you\'ve followed the ' +
'installation instructions in this project\'s readme: ' + ex);
return;
}
python.callSync(this.rfDevice, 'enable_tx');
Expand Down

0 comments on commit ff31183

Please sign in to comment.