iobroker.tvprogram
Advanced tools
Comparing version 1.1.0 to 1.1.2
{ | ||
"common": { | ||
"name": "tvprogram", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"news": { | ||
"1.1.2": { | ||
"en": "* fix setState with ack==false" | ||
}, | ||
"1.1.1": { | ||
"en": "* remove dead code / extend doku about the warnings in the iobroker log * change the method of setting for configuration data from widget to datapoint" | ||
}, | ||
"1.1.0": { | ||
@@ -233,3 +239,3 @@ "en": "tooltips for the buttons in the time widget / search through the whole text to also find directors and actors / add showpictures option in time,control and search widget / improve documentation", | ||
"messagebox": true, | ||
"type": "visualization", | ||
"type": "misc-data", | ||
"compact": true, | ||
@@ -273,2 +279,2 @@ "connectionType": "cloud", | ||
] | ||
} | ||
} |
@@ -150,2 +150,6 @@ | ||
} | ||
if (msg.command === 'setValueAck') { | ||
this.log.debug('send setValueAck'); | ||
this.setValueAckMsg(msg); | ||
} | ||
} | ||
@@ -155,3 +159,3 @@ this.doStateChange = function(id,state) { | ||
// Warning, state can be null if it was deleted | ||
if (!id || !state || state.ack ) { | ||
if (!id || !state ) { | ||
return; | ||
@@ -162,2 +166,7 @@ } | ||
idParts.shift(); | ||
if ( state.ack && idParts[1] == 'cmd') { | ||
if (idParts[1] == 'cmd' ) this.doStateChangeCmd(idParts,state); | ||
} else { | ||
return; | ||
} | ||
if (idParts[1] == 'selectchannel' ) this.doStateChangeSelectChannel(idParts,state); | ||
@@ -169,3 +178,2 @@ if (idParts[1] == 'name' ) this.doStateChangeName(idParts,state); | ||
if (idParts[1] == 'show' ) this.doStateChangeShow(idParts,state); | ||
if (idParts[1] == 'cmd' ) this.doStateChangeCmd(idParts,state); | ||
if (idParts[1] == 'record' ) this.doStateChangeRecord(idParts,state); | ||
@@ -211,3 +219,3 @@ }; | ||
this.log.debug("doStateChangeCmd"); | ||
if (typeof state.val == "string") { | ||
if (typeof state.val == "string" && state.val!="") { | ||
this.setState(idParts[1],"",idParts[0]); | ||
@@ -401,2 +409,11 @@ } | ||
} | ||
this.setValueAckMsg = function(msg) { | ||
this.log.silly('setValueAckMsg '); | ||
if (typeof msg.message=="object") { | ||
var id = msg.message.id; | ||
var value = msg.message.value; | ||
this.setState(id,value); | ||
} | ||
if (msg.callback) this.adapter.sendTo(msg.from, msg.command, data, msg.callback); | ||
} | ||
this.getServerInfoMsg = function(msg) { | ||
@@ -538,89 +555,2 @@ this.log.silly('getServerInfoMsg '); | ||
} | ||
/* | ||
this.createDatapoints1 = function(callback) { | ||
pName = new Promise((resolve, reject)=>{ | ||
const stateTemplatename = JSON.parse(JSON.stringify(this.stateTemplate['name'])); | ||
this.getState(stateTemplatename.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplatename,null,null,function(resolve){ | ||
if (!data) data={val:"{}"}; | ||
this.setState(stateTemplatename.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pConfig = new Promise((resolve, reject)=>{ | ||
const stateTemplateconfig = JSON.parse(JSON.stringify(this.stateTemplate['config'])); | ||
this.getState(stateTemplateconfig.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplateconfig,null,null,function(resolve){ | ||
if (!data) data={val:"{}"}; | ||
this.setState(stateTemplateconfig.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pFavorites = new Promise((resolve, reject)=>{ | ||
const stateTemplatefavorites = JSON.parse(JSON.stringify(this.stateTemplate['favorites'])); | ||
this.getState(stateTemplatefavorites.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplatefavorites,null,null,function(resolve){ | ||
if (!data) data={val:"[]"}; | ||
this.setState(stateTemplatefavorites.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pChannelfilter = new Promise((resolve, reject)=>{ | ||
const stateTemplatechannelfilter = JSON.parse(JSON.stringify(this.stateTemplate['channelfilter'])); | ||
this.getState(stateTemplatechannelfilter.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplatechannelfilter,null,null,function(resolve){ | ||
if (!data) data={val:"[]"}; | ||
this.setState(stateTemplatechannelfilter.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pShow = new Promise((resolve, reject)=>{ | ||
const stateTemplateshow = JSON.parse(JSON.stringify(this.stateTemplate['show'])); | ||
this.getState(stateTemplateshow.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplateshow,null,null,function(resolve){ | ||
if (!data) data={val:"1"}; | ||
this.setState(stateTemplateshow.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pChannel = new Promise((resolve, reject)=>{ | ||
stateTemplateselch = JSON.parse(JSON.stringify(this.stateTemplate['selectchannel'])); | ||
this.getState(stateTemplateselch.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplateselch,null,null,function(resolve){ | ||
if (!data) data={val:""}; | ||
this.setState(stateTemplateselch.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pCmd = new Promise((resolve, reject)=>{ | ||
stateTemplateselcmd = JSON.parse(JSON.stringify(this.stateTemplate['cmd'])); | ||
this.getState(stateTemplateselcmd.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplateselcmd,null,null,function(resolve){ | ||
if (!data) data={val:""}; | ||
this.setState(stateTemplateselcmd.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
pRecord = new Promise((resolve, reject)=>{ | ||
stateTemplateselrecord = JSON.parse(JSON.stringify(this.stateTemplate['record'])); | ||
this.getState(stateTemplateselrecord.name,false,false,function(resolve,err,data) { | ||
this.createObjectNotExist(stateTemplateselrecord,null,null,function(resolve){ | ||
if (!data) data={val:""}; | ||
this.setState(stateTemplateselrecord.name,data.val); | ||
resolve(); | ||
}.bind(this,resolve)); | ||
}.bind(this,resolve)); | ||
}); | ||
Promise.all([pName, pConfig, pFavorites, pChannelfilter, pShow, pChannel, pCmd, pRecord]).then(() => { | ||
callback(); | ||
}); | ||
} | ||
*/ | ||
this.createDatapointsPath = function(path=null,callback) { | ||
@@ -698,3 +628,3 @@ pName = new Promise((resolve, reject)=>{ | ||
this.tvdata.categories=data.category; | ||
tvs.map((tv)=> this.setStateNoAck("cmd","new|categories",tv)); | ||
tvs.map((tv)=> this.setState("cmd","new|categories",tv)); | ||
} | ||
@@ -711,3 +641,3 @@ }); | ||
this.tvdata.channels=data.channels; | ||
tvs.map((tv)=> this.setStateNoAck("cmd","new|channels",tv)); | ||
tvs.map((tv)=> this.setState("cmd","new|channels",tv)); | ||
} | ||
@@ -724,3 +654,3 @@ }); | ||
this.tvdata.genres=data.genres; | ||
tvs.map((tv)=> this.setStateNoAck("cmd","new|genres",tv)); | ||
tvs.map((tv)=> this.setState("cmd","new|genres",tv)); | ||
} | ||
@@ -743,3 +673,3 @@ }); | ||
this.tvdata.program[datum]=data.events; | ||
tvs.map((tv)=> this.setStateNoAck("cmd","new|program|"+datum,tv)); | ||
tvs.map((tv)=> this.setState("cmd","new|program|"+datum,tv)); | ||
} | ||
@@ -765,78 +695,2 @@ }.bind(this,this.formatedDate(dstart))); | ||
} | ||
/* | ||
this.getData1 = function() { | ||
this.log.silly('getData'); | ||
this.getCategories(function(data){ | ||
if (data=="error") { | ||
data = this.readFileSync('categories.json'); | ||
if (data=="error") data={category:[]}; | ||
} | ||
if (JSON.stringify(this.tvdata.categories) != JSON.stringify(data.category)) { | ||
this.log.debug('getData first request or changed data categories'); | ||
this.writeFile('categories.json',data.category); | ||
this.tvdata.categories=data.category; | ||
this.setStateNoAck("cmd","new|categories"); | ||
} | ||
}.bind(this)); | ||
this.getChannels(function(data){ | ||
if (data=="error") { | ||
data = this.readFileSync('channels.json'); | ||
if (data=="error") data={channels:[]}; | ||
} | ||
if (JSON.stringify(this.tvdata.channels) != JSON.stringify(data.channels)) { | ||
this.log.debug('getData first request or changed data channels'); | ||
this.writeFile('channels.json',data.channels); | ||
this.tvdata.channels=data.channels; | ||
this.setStateNoAck("cmd","new|channels"); | ||
} | ||
}.bind(this)); | ||
this.getGenres(function(data){ | ||
if (data=="error") { | ||
data = this.readFileSync('genres.json'); | ||
if (data=="error") data={genres:[]}; | ||
} | ||
if (JSON.stringify(this.tvdata.genres) != JSON.stringify(data.genres)) { | ||
this.log.debug('getData first request or changed data genres'); | ||
this.writeFile('genres.json',data.genres); | ||
this.tvdata.genres=data.genres; | ||
this.setStateNoAck("cmd","new|genres"); | ||
} | ||
}.bind(this)); | ||
var dstart = new Date(); | ||
var dend = new Date(); | ||
dend.setDate(dend.getDate()+5); | ||
while(dstart <= dend){ | ||
this.getProgram(dstart,function(dstart,data){ | ||
if (data=="error") { | ||
data = this.readFileSync('program/'+dstart+'.json'); | ||
if (data=="error") data={events:[]}; | ||
} | ||
data.events = this.shrinkTVProgramWithText(data.events); | ||
if (JSON.stringify(this.tvdata.program[dstart]) != JSON.stringify(data.events)) { | ||
this.log.debug('getData first request or changed data events ' + dstart); | ||
this.writeFile('program/'+dstart+'.json',data); | ||
this.tvdata.program[dstart]=data.events; | ||
this.setStateNoAck("cmd","new|program|"+dstart); | ||
} | ||
}.bind(this,this.formatedDate(dstart))); | ||
dstart.setDate(dstart.getDate() + 1); | ||
} | ||
dstart = new Date(); | ||
dstart.setDate(dstart.getDate() - 1); | ||
dend = new Date(); | ||
dend.setDate(dend.getDate()-5); | ||
while(dstart >= dend){ | ||
data = this.readFileSync('program/'+this.formatedDate(dstart)+'.json'); | ||
if (data=="error") { | ||
dstart.setDate(dstart.getDate() - 1); | ||
continue; | ||
} | ||
this.tvdata.program[this.formatedDate(dstart)]=data.events; | ||
dstart.setDate(dstart.getDate() - 1); | ||
} | ||
this.removeFiles(); | ||
} | ||
*/ | ||
this.getProgram = function(datum,callback) { | ||
@@ -843,0 +697,0 @@ this.log.silly('getProgram'); |
{ | ||
"name": "iobroker.tvprogram", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "This adapter polls information about the television program at regular intervals. The data can be displayed in various widgets", | ||
@@ -20,38 +20,38 @@ "author": { | ||
"dependencies": { | ||
"@iobroker/adapter-core": "^2.4.0", | ||
"@sentry/browser": "^6.2.0", | ||
"@iobroker/adapter-core": "^2.5.1", | ||
"@sentry/browser": "^6.11.0", | ||
"parcel-plugin-build-hooks": "^1.1.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.13.0", | ||
"@babel/core": "^7.13.8", | ||
"@iobroker/adapter-react": "^1.6.1", | ||
"@iobroker/testing": "^2.4.2", | ||
"@material-ui/core": "^4.11.3", | ||
"@babel/cli": "^7.14.8", | ||
"@babel/core": "^7.15.0", | ||
"@iobroker/adapter-react": "^2.0.8", | ||
"@iobroker/testing": "^2.4.4", | ||
"@material-ui/core": "^4.12.3", | ||
"@material-ui/icons": "^4.11.2", | ||
"@types/chai": "^4.2.15", | ||
"@types/chai-as-promised": "^7.1.3", | ||
"@types/gulp": "^4.0.8", | ||
"@types/mocha": "^8.2.1", | ||
"@types/node": "^14.14.31", | ||
"@types/chai": "^4.2.21", | ||
"@types/chai-as-promised": "^7.1.4", | ||
"@types/gulp": "^4.0.9", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^16.4.13", | ||
"@types/proxyquire": "^1.3.28", | ||
"@types/react": "^17.0.2", | ||
"@types/react-dom": "^17.0.1", | ||
"@types/sinon": "^9.0.10", | ||
"@types/react": "^17.0.16", | ||
"@types/react-dom": "^17.0.9", | ||
"@types/sinon": "^10.0.2", | ||
"@types/sinon-chai": "^3.2.5", | ||
"axios": "^0.21.1", | ||
"chai": "^4.3.0", | ||
"chai": "^4.3.4", | ||
"chai-as-promised": "^7.1.1", | ||
"eslint": "^7.21.0", | ||
"eslint-plugin-react": "^7.22.0", | ||
"eslint": "^7.32.0", | ||
"eslint-plugin-react": "^7.24.0", | ||
"gulp": "^4.0.2", | ||
"mocha": "^8.3.0", | ||
"parcel-bundler": "^1.12.4", | ||
"mocha": "^9.0.3", | ||
"parcel-bundler": "^1.12.5", | ||
"proxyquire": "^2.1.3", | ||
"react": "^17.0.1", | ||
"react-dom": "^17.0.1", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-icons": "^4.2.0", | ||
"sinon": "^9.2.4", | ||
"sinon-chai": "^3.5.0", | ||
"typescript": "^4.2.2" | ||
"sinon": "^11.1.2", | ||
"sinon-chai": "^3.7.0", | ||
"typescript": "^4.3.5" | ||
}, | ||
@@ -58,0 +58,0 @@ "parcel-plugin-build-hooks": { |
@@ -34,2 +34,11 @@ ![Logo](admin/tvprogram.png) | ||
You can configure how much different TVs, or at least different configurations you will have. | ||
### Warnings in the iobroker-log | ||
Warnings like | ||
"Read-only state "tvprogram.0.tv1.cmd" has been written without ack-flag with value "new|program|2021-01-01" | ||
are ok by design, due the internal signalling mechanism between the adapter and the widgets, which are first set without the ack flag and after a while is reset with the ack flag. | ||
### Widgets | ||
@@ -674,6 +683,7 @@ | ||
## Changelog | ||
### 1.1.1 (2021-08-10) | ||
* remove dead code / extend doku about the warnings in the iobroker log * change the method of setting for configuration data from widget to datapoint | ||
### 1.1.0 (2021-05-06) | ||
* tooltips for the buttons in the time widget / search through the whole text to also find directors and actors / add showpictures option in time,control and search widget / improve documentation | ||
### 1.0.0 | ||
@@ -680,0 +690,0 @@ * (oweitman) stable version |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
712
1129509
8828
Updated@sentry/browser@^6.11.0