tomhaskell / node-panasonic-viera Goto Github PK
View Code? Open in Web Editor NEWNode.js control for a Panasonic Viera TV
License: MIT License
Node.js control for a Panasonic Viera TV
License: MIT License
Hi Tom,
I'm trying to incorporate your library into a homebridge-plugin: homebridge-panasonictv (work is being done in my fork).
This basically works pretty well, but I would like to be notified about errors that might occur. Specifically when the TV is not reachable, but this code hides/swallows the errors from the caller:
var req = http.request(post_options, function(res) {
//console.log('STATUS: ' + res.statusCode);
//console.log('HEADERS: ' + JSON.stringify(res.headers));
res.setEncoding('utf8');
res.on('data', self.callback);
});
req.on('error', function(e) {
console.log('error: ' + e.message);
console.log(e);
});
Do you think it's viable to extend the callback with an error object?
Have you ever tried to run this code from Raspberry Pi? It works very well from my Windows Laptops as well as from Android devices, but not from my Pis (1+3, Rasbian and ArchLinux). On the Raspberries I always receive Error 403.
I reduced what you do to:
curl 'http://192.168.178.142:55000/nrc/control_0' \
-H 'soapaction: "urn:panasonic-com:service:p00NetworkControl:1#X_SendKey"' \
--data-binary '<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_SendKey xmlns:u="urn:panasonic-com:service:p00NetworkControl:1"><X_KeyEvent>NRC_MUTE-ONOFF</X_KeyEvent></u:X_SendKey></s:Body></s:Envelope>' \
-w '%{http_code}'
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=197992
https://stackoverflow.com/questions/47367993
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.