Skip to content

Commit

Permalink
v5.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Oct 8, 2021
1 parent 1f609cd commit 05a84ed
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 84 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ typings/

# dotenv environment variables file
.env
homebridge-ui/public
homebridge-ui/public
test.js
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ example-config.json
.prettierrc.json
.eslintrc.js
images/hb_braviatvos_ui_final.gif
homebridge-ui/ui
homebridge-ui/ui
test.js
11 changes: 11 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

# v5.0.8 - 2021-10-08

## Breaking Changes
- Commands with the same values are now merged. If you have used commands as inputs, please remove the TV cache and create a new one by clicking the "refresh" button in the UI and revise your config

## Notable Changes
- Added new tv channel source: `ATSCT`

## Bugfixes
- Minor Bugfixes

# v5.0.7 - 2021-10-02

## Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ You need to put the PSK entered in your tv also in your config.json.
|----------------|--------------|-----------|-------------|-------------|
| channels.name | **X** | Name for the channel to display in the tv inputs list
| channels.channel | **X** | Number of the channel as seen on the TV.
| channels.source | **X** | Source of the channel. | | `dvbt`, `dvbc`, `dvbs`, `isdbt`, `isdbc`, `isdbs`, `analog`
| channels.source | **X** | Source of the channel. | | `dvbt`, `dvbc`, `dvbs`, `isdbt`, `isdbc`, `atsct`, `isdbs`, `analog`

## Options TV Commands

Expand Down
4 changes: 4 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@
"title": "ISDBC",
"enum": ["isdbc"]
},
{
"title": "ATSCT",
"enum": ["atsct"]
},
{
"title": "Analog",
"enum": ["analog"]
Expand Down
28 changes: 17 additions & 11 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,54 +202,60 @@ class UiServer extends HomebridgePluginUiServer {

//REFRESH APPS
apps.forEach((app) => {
const cachedApp = tvCache.apps.find((cachedApp) => cachedApp.name === app.name);
const cachedApp = tvCache.apps.find((cachedApp) => cachedApp && cachedApp.name === app.name);

if (!cachedApp) {
tvCache.apps.push(app);
}
});

//REMOVE NOT EXISTING APPS
tvCache.apps = tvCache.apps.filter((cachedApp) => apps.find((app) => app.name === cachedApp.name));
tvCache.apps = tvCache.apps.filter((cachedApp) => cachedApp && apps.find((app) => app.name === cachedApp.name));

//REFRESH CHANNELS
channels.forEach((channel) => {
const cachedChannel = tvCache.channels.find((cachedChannel) => cachedChannel.uri === channel.uri);
const cachedChannel = tvCache.channels.find(
(cachedChannel) => cachedChannel && cachedChannel.uri === channel.uri
);

if (!cachedChannel) {
tvCache.channels.push(channel);
}
});

//REMOVE NOT EXISTING APPS
tvCache.channels = tvCache.channels.filter((cachedChannel) =>
channels.find((channel) => channel.uri === cachedChannel.uri)
tvCache.channels = tvCache.channels.filter(
(cachedChannel) => cachedChannel && channels.find((channel) => channel.uri === cachedChannel.uri)
);

//REFRESH COMMANDS
commands.forEach((command) => {
const cachedCommand = tvCache.commands.find((cachedCommand) => cachedCommand.value === command.value);
const cachedCommand = tvCache.commands.find(
(cachedCommand) => cachedCommand && cachedCommand.value === command.value
);

if (!cachedCommand) {
tvCache.commands.push(command);
}
});

/*tvCache.commands = tvCache.commands.filter((cachedCommand) =>
commands.find((command) => command.value === cachedCommand.value)
);*/
tvCache.commands = tvCache.commands.filter(
(cachedCommand) => cachedCommand && commands.find((command) => command.value === cachedCommand.value)
);

//REFRESH INPUTS
inputs.forEach((exInput) => {
const cachedExInput = tvCache.inputs.find((cachedExInput) => cachedExInput.uri === exInput.uri);
const cachedExInput = tvCache.inputs.find(
(cachedExInput) => cachedExInput && cachedExInput.uri === exInput.uri
);

if (!cachedExInput) {
tvCache.inputs.push(exInput);
}
});

/*tvCache.inputs = tvCache.inputs.filter((cachedExInput) =>
inputs.find((exInput) => exInput.uri === cachedExInput.uri)
inputs.find((exInput) => exInput && exInput.uri === cachedExInput.uri)
);*/

await this.storeTV(tvCache, television.name);
Expand Down
4 changes: 4 additions & 0 deletions homebridge-ui/ui/src/mixins/homebridge.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ export default {
title: 'ISDBC',
enum: ['isdbc'],
},
{
title: 'ATSCT',
enum: ['atsct'],
},
{
title: 'Analog',
enum: ['analog'],
Expand Down
112 changes: 63 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-bravia-tvos",
"version": "5.0.7",
"version": "5.0.8",
"description": "Homebridge plugin for Sony Bravia Android TVs",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -54,10 +54,10 @@
"fs-extra": "^10.0.0"
},
"devDependencies": {
"@babel/core": "7.15.5",
"@babel/eslint-parser": "7.15.7",
"@babel/core": "7.15.8",
"@babel/eslint-parser": "7.15.8",
"@babel/eslint-plugin": "7.14.5",
"concurrently": "^6.2.2",
"concurrently": "^6.3.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
Expand Down
2 changes: 1 addition & 1 deletion src/accessories/accessory.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const Config = (tvConfig) => {
const validDisplayCatagories = ['apps', 'channels', 'commands', 'inputs', 'macros'];
const validSpeakerOutput = ['speaker', 'headphone', 'other'];
const validSpeakerAccTypes = ['lightbulb', 'switch', 'fan'];
const validChannelSources = ['dvbt', 'dvbc', 'dvbs', 'isdbt', 'isdbs', 'isdbc', 'analog'];
const validChannelSources = ['dvbt', 'dvbc', 'dvbs', 'isdbt', 'isdbs', 'isdbc', 'atsct', 'analog'];
const validInputSources = ['cec', 'component', 'composite', 'hdmi', 'scart', 'widi'];

tvConfig.speaker = tvConfig.speaker || {};
Expand Down
Loading

0 comments on commit 05a84ed

Please sign in to comment.