Comments (5)
@dhylands Have you started working on anything like this yet by any chance? I need this for the next step on the front end, to actually turn the on/off switches on and off :)
from gateway.
Looking through the code of the DebugController it looks like I could create a PropertyController with a PUT handler that looks something like this...
var device = adapterManager.getDevice(deviceId);
if (device) {
var attribute = device.getAttribute(attributeId);
if (attribute) {
var attributeValue = request.body[attributeId];
if (attributeValue !== undefined) {
device.setAttributeValue(attributeId, attributeValue);
response.send();
return;
}
Should I do that, or do you think we should add a method on the adapter manager? Really I guess the adapter should be translating WebThing property names into Z-Wave device attribute names.
from gateway.
Yeah - I think that the adapter manager should be creating WebThing property names, and then those should be used to create the REST API.
So it would be very similar to what you have above, although I'd probably use 'Property' rather than 'Attribute' if we're going to generate WebThing properties.
from gateway.
OK, well if there was a method on AdapterManager where I could just call AdapterManager.setProperty(deviceId, propertyName, value) with the Web Thing property name, that would be awesome :)
from gateway.
Implemented
from gateway.
Related Issues (20)
- Properly implement the `OAuth2SecurityScheme`
- Support `ImageProperty` and `VideoProperty` properties using `forms`
- Missing implementations for adding / removing actions? HOT 1
- Re-factor "context menu" as separate dialogs
- `WebSocket sendMessage failed` when adding a thing to a group HOT 1
- Things get rendered twice HOT 2
- Use new overflow menu design everywhere
- Cannot start container, nodejs error HOT 1
- Confirm deletion of user account
- Confirm removal of add-on HOT 2
- Consider warning users that tunnel can't be configured after first time setup
- Error on startup with docker-compose HOT 2
- Things or "No devices yet" message do not appear on first boot
- Back button on Thing detail view not working
- RPI3+ 1.2.0-alpha.1 - Missing refreshes in 'Things' view ? HOT 1
- WebThings Gateway 1.2 Alpha testing feedback HOT 6
- Zigbee & Z-Wave Things missing properties HOT 4
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
- Existing Things have both links and forms after upgrade
- Set `synchronous` to `false` in action affordances in Thing Descriptions
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 gateway.