Skip to content

Commit

Permalink
v5.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Sep 26, 2021
1 parent a97e338 commit 6be1dd8
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 71 deletions.
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.6 - 2021-09-26

## Other Changes
- Support for older TV models which does not support all methods used by this plugin
- Bump dependencies

## Bugfixes
- Fixed an issue where updating the TV via `refreshInputs` saved incorrect data
- Fixed an issue where `oldModel` didnt work properly
- Minor UI bugfixes

# v5.0.5 - 2021-09-21

## Notable Changes
Expand Down
2 changes: 1 addition & 1 deletion config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"oldModel": {
"title": "Old Model",
"type": "boolean",
"description": "Some TV models go offline after a certain time (when the TV is turned off) and the API is no longer accessible, which causes errors in the log. Enable this option to hide these errors in the log. (Note: For these types of TVs, please also specify the Mac address in config.json).",
"description": "Some TV models go offline after a certain time (when the TV is turned off) and the API is no longer accessible, which causes errors in the log. Enable this option to hide these errors in the log. (Note: For these types of TVs, please also specify the Mac address in config.json and enable wol).",
"condition": {
"functionBody": "try { return model.tvs[arrayIndices[0]].active } catch(e){ return false }"
}
Expand Down
2 changes: 1 addition & 1 deletion homebridge-ui/ui/src/utils/config.schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default {
title: 'Old Model',
type: 'boolean',
description:
'Some TV models go offline after a certain time (when the TV is turned off) and the API is no longer accessible, which causes errors in the log. Enable this option to hide these errors in the log. (Note: For these types of TVs, please also specify the Mac address in config.json).',
'Some TV models go offline after a certain time (when the TV is turned off) and the API is no longer accessible, which causes errors in the log. Enable this option to hide these errors in the log. (Note: For these types of TVs, please also specify the Mac address in config.json and enable wol).',
condition: {
functionBody: 'try { return model.tvs.active } catch(e){ return false }',
},
Expand Down
24 changes: 10 additions & 14 deletions homebridge-ui/ui/src/views/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ export default {
return this.$router.push({ path: '/' });
}
const inputs = (await window.homebridge.request('/getTV', this.newName)) || {
apps: [],
channels: [],
commands: [],
inputs: [],
macros: [],
};
const tvCache = await window.homebridge.request('/getTV', this.newName);
this.customSchema = await this.generatePluginShema(pluginConfig, this.television, inputs);
this.customSchema = await this.generatePluginShema(pluginConfig, this.television, tvCache);
this.customSchema.onChange(async (config) => {
if (this.waitForChanges) {
Expand All @@ -71,7 +65,7 @@ export default {
pluginConfig.tvs = pluginConfig.tvs.map((tv) => {
if (tv.name === this.newName) {
if (inputs.channels.length) {
if (tvCache.channels.length) {
config.tvs.channels = (config.tvs.channels || []).map((channel) => {
return {
name: channel.name,
Expand All @@ -81,9 +75,9 @@ export default {
});
}
if (inputs.commands.length) {
if (tvCache.commands.length) {
config.tvs.commands = (config.tvs.commands || []).map((command) => {
const inputCommand = inputs.commands.find(
const inputCommand = tvCache.commands.find(
(cmd) => cmd.name === command.value || cmd.value === command.value
);
Expand Down Expand Up @@ -117,7 +111,9 @@ export default {
config.tvs.macros = (config.tvs.macros || []).map((macro) => {
macro.commands = (macro.commands || []).map((command) => {
const inputCommand = inputs.commands.find((cmd) => cmd.name === command || cmd.value === command);
const inputCommand = tvCache.commands.find(
(cmd) => cmd.name === command || cmd.value === command
);
if (inputCommand) {
command = inputCommand.name;
Expand All @@ -130,7 +126,7 @@ export default {
});
config.tvs.remote = (config.tvs.remote || []).map((remote) => {
const inputCommand = inputs.commands.find(
const inputCommand = tvCache.commands.find(
(cmd) => cmd.name === remote.command || cmd.value === remote.command
);
Expand All @@ -142,7 +138,7 @@ export default {
});
}
if (inputs.inputs.length) {
if (tvCache.inputs.length) {
config.tvs.inputs = (config.tvs.inputs || []).map((input) => {
return {
name: input.name,
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-bravia-tvos",
"version": "5.0.5",
"version": "5.0.6",
"description": "Homebridge plugin for Sony Bravia Android TVs",
"main": "index.js",
"repository": {
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"dependencies": {
"@homebridge/plugin-ui-utils": "^0.0.19",
"@seydx/bravia": "^2.0.0-beta.14",
"@seydx/bravia": "^2.0.0-beta.20",
"fs-extra": "^10.0.0"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 6be1dd8

Please sign in to comment.