Skip to content

Commit

Permalink
V3.0.0 - replace python mqtt script with mqtt.js (#62)
Browse files Browse the repository at this point in the history
* added basic mqtt client + logs

* Fixed import

* Added log in disconnect

* update characteristic in mqtt callbacks

* Added topic to log message

* Reworked application

* Fix log

* Fix wrong mac adress

* Fix missing argument

* Fix sendKey -> sendkey

* added additional log message

* Fixed activeIdentifier not set on first pull

* Fix key input

* disable mqtt queueQoSZero

* added faster checking for tv state

* Force disconnection

* reconnect only once

* added mqtt event close/end

* added pollingInterval to schema

* Added default for pollingInterval incase of missing migration

* Added native script for authorization

* Fix type error

* Move authorize into its own script

* Add shebang to authorize.ts

* Fix open issues

* Fix authorization workflow

* Added error message for failed authorization

* Subscribe to correct topic

* Subscribe to correct topic

* fix result validation

* Changed subscribe location in authorize

* Addapted changelog

* deleted python script

* Removed python dependencies

* added dynamic threshold to counter logic

* Changed README and adapted default values

* Fixed bug with false negative/positives handling

* Fixed source comparison

* Only disconnect if needed

* Fix liniting issues

* Added more instructions to README.md

* Added settings for Always On TVs

* changed version in package.json

* fix config schema

* Fix macaddress input

* Early terminate process instead of throwing an error

* Added placeholder and fixed type in config.schema

* Changed layout order in schema

* Fix macaddress not assigned in platform.ts

* Send WOL Packages multiple times

* Increase wol timeout

* added form to schema

* hide ssl cert/key if not needed

* Added wol options to codebase

* Updated Changelog

* Removed address from wolOptions

* Removed telnet dependencie

* Added apps as input sources

* Fix config schema

* Added log message for adding apps

* Fix if condition

* Fixed issues

* Added empty urlType parameter

* Fix typing issue

* Fix typing issue

* fixed inputs for changing app

* Workaround for clicking on unknown

* Replace write response with update characteristic

* Remove updateCharacteristic

* Refactoring into smaller parts/removing duplicates

* Add key_mute to speakerService

* Add documentation

* Add new features into readme

* FIx readme

* Fix readme

* Fix readme

* Fix link in readme

* Changed wording in readme

* Updated Changelog

* Fix broken config variable check

* Bump version to 3.0.0-beta.2

* update tsconfig.json

* renamed mqtt-helper

* improved changelog and readme

* Added comment

* Bump version to 3.0.0-beta.3

* Fix broken module config

* Bump version to 3.0.0-beta.4 to fix broken module

* align tsconfig with homebridge-plugin-template

* align tsconfig with homebridge-plugin-template

* Fix imports in index.ts

* Fix imports in all files

* ES6 import removed

* Fix missing import

* Bump version to 3.0.0-beta.5 to actually fix broken modules

* Fix custom scripts

* Added connection errors to scripts

* Added script termination and line ending after error message

* Bump version to 3.0.0-beta.6 to fix custom scripts

* Added validation for new config options

* replaced logger with logging

* bumped version to 3.0.0 and updated all versions

* bumped version of dev dependencies

* updated README
  • Loading branch information
LeLunZ authored Jul 22, 2024
1 parent a6068c1 commit e7f5165
Show file tree
Hide file tree
Showing 27 changed files with 1,797 additions and 1,492 deletions.
8 changes: 7 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@
"plugin:@typescript-eslint/recommended" // uses the recommended rules from the @typescript-eslint/eslint-plugin
],
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": 2022,
"sourceType": "module"
},
"ignorePatterns": [
"dist"
],
"rules": {
"no-restricted-imports": ["error", { "patterns": [{
"group": ["./scripts/*"],
"message": "Scripts should not be imported in the main codebase. They are only meant to be run from the command line."
}]
}],

"quotes": ["warn", "single"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
"semi": ["off"],
Expand Down
54 changes: 0 additions & 54 deletions .homebridge/config.json

This file was deleted.

51 changes: 47 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# 2.0.2
# 3.0.0

- Fixed plugin to work with newer versions of homebridge.
- Fixed order of Input Sources
- Added additional logs and error handling
This release has **braking changes**.
Please read through the plugins documentation and update your configuration accordingly.

### Config Changes

- `ifname` is now `macaddress` and should be the mac address of the homebridge server
- changes in `devices`
- `showApps` (default: false) - show apps as input sources
- `apps` (default: []) - list of apps to show as input sources
- if none are provided, all apps are shown
- `tvType` for always on tvs added
- `default` normal tv
- `fakeSleep` tv with always on where fakeSleep property is used
- `pictureSettings` tv with always on where sleep needs to be detected through the tvs picture settings
- if `tvType` is `pictureSettings` the following properties are required
- `menuId` - the picture setting to check for sleep
- `menuFlag` - the value of the picture settings to check for sleep
- Advanced Settings section:
- `pollingInterval` (default: 4) - seconds to wait between polling the tv for the on/off state
- if you have a tv that is always on, polling is disabled and changing this doesn't do anything
- `wolInterval` (default: 400) - milliseconds to wait between sending WoL packets
- `wolRetries` (default: 3) - number of times to send WoL packets to account for packet loss



### Changed
- Instead of using the ifname to get the macaddress, users should now enter there macaddress directly
- Plugin now connects to mqtt directly while tv is online
- Connection will stay open as long as possible
- Input Source is now updated in real time
- Changing source with the home app works now most of the time
- WoL packets are now sent multiple times in the background
- I noticed that the tv sometimes doesn't wake up on the first packet as the packet got lost or the network interface of the tv has some issues
- Removed telnet dependency as it wasn't used anymore


### Added
- Support for showing apps as Input Sources
- showApps and apps config options
- Added support for always on tvs
- see tvType and the menuId and menuFlag properties
- Added `hisense-tv-authorize` and `hisense-tv-always-on-test` scripts to help with the setup
- Added additional config properties
- pollingInterval
- wolInterval
- wolRetries
Loading

0 comments on commit e7f5165

Please sign in to comment.