Comments (6)
- - The plugin must successfully install.
- - The plugin must impliment the Homebridge Plugin Settings GUI.
- - The plugin must not start unless it is configured.
- - The plugin must not execute postinstall scripts that modify the users system in any way.
- - The plugin must not contain any analytics or calls that enable you to track the user.
- - The plugin must not throw unhandled exceptions, the plugin must catch and log it's own errors.
- - The plugin must be published to npm and the source code available on GitHub.
- - The plugin must run on all Active LTS versions of Node.js, at the time of writing this is Node.js v10 and v12.
- - The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
- - If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.
The plugin must not throw unhandled exceptions, the plugin must catch and log it's own errors
If an entry in the devices[]
array does not contain a "name` attribute the following error is raised and Homebridge crashes:
[3/29/2020, 21:26:36] [AV Receiver] Initializing DenonTv platform...
[3/29/2020, 21:26:36] Error: Accessories must be created with a non-empty displayName.
It looks like the config.schema.json
also needs updating to include the name
property under the devices
array.
To prevent it from crashing when no name
is provided you could add this to about line 40:
if (!deviceName.name) {
this.log.warn('Device Name Missing')
} else {
this.tvAccessories.push(new denonTvDevice(log, deviceName, api));
}
This might be a good place to validate the rest of the config as well.
If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.
The plugin is writing files to /Users/xxxx/Library/Preferences/denonTv/
due to the persist-path
module.
These should be stored in the Homebridge storage directory. You can get the storage directory for the current instance of Homebridge by calling:
api.user.storagePath()
from verified.
The plugin must not throw unhandled exceptions, the plugin must catch and log it's own errors
If the devices[]
array does not exist in the config Homebridge will crash.
You could fix this on line 23 by checking devices exists before loading the plugin:
if (!config || !Array.isArray(config.devices)) {
from verified.
Can U point me how to use this to get the storagePath?
api.user.storagePath();
from verified.
api
is just the 3rd function argument of your platform constructor.
https://github.com/grzegorz914/homebridge-denon-tv/blob/master/index.js#L21
From here you can just call something like:
this.prefDir = path.join(api.user.storagePath(), 'denonTv');
Note using path.join
is safer (and enables cross platform compatibility) than joining paths using string concatenation.
from verified.
Thanks,
all updated and fixed.
from verified.
Looks good!
from verified.
Related Issues (20)
- homebridge-pentair-screenlogic HOT 4
- homebridge-eggtimer-plugin HOT 9
- homebridge-tp-link-access-control HOT 18
- homebridge-shelly-2pm-plus HOT 8
- homebridge-http-leak-sensor HOT 8
- homebridge-alexa-smarthome HOT 12
- homebridge-purpleair HOT 8
- homebridge-airport-express-connected HOT 6
- homebridge-sharkiq HOT 8
- homebridge-davisfixed HOT 9
- homebridge-multiswitcheroo HOT 18
- homebridge-http-json-thermometer HOT 8
- homebridge-purpleair HOT 8
- homebridge-switchbot-sensor-ble HOT 22
- homebridge-davis HOT 11
- homebridge-rademacher-homepilot HOT 16
- homebridge-actron-neo HOT 7
- homebridge-mqttsmokesensor HOT 5
- homebridge-mqttsmokesensor HOT 7
- homebridge-actron-neo HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from verified.