* Update underlying docker containers and dependencies. * Minor linting and code issues fixes * Update supported devices section * Improve Mqtt message properties - retain, etc. - Retain discovery messages - Don't retain others - Set QoS to 1 consistently to ensure at least once delivery - Set session timeout to ensure a reasonable TTL on messages * Code and logic to remove any retained mqtt messages for SET/STATE/AVAILABILITY * Temporary restructure of init flow for mqtt. - No longer wait for HA birth message - Don't listen to incoming messages until old retained messages have been purged. - More details in https://github.com/icanos/hassio-plejd/issues/218 * Fix lingering incorrect access of connectedDevice.id * Fix to avoid Home Assistant setting retain flag on MQTT SET STATE messages * Parse new TRAIT=15, assuming this means dimmable and tunable white * Clarify TRAITS bitmask values * Add experimental parsing for color temp support from Plejd API * Lint fixes * Remove null coalescing operator since we don't compile code * Handle case where outputSettings is null in PlejdApi * Solve MQTT errors due to deprecated api color_temp and unsupported removal of retained state messages
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
// const path = require('path');
|
|
|
|
// {
|
|
// "extends": ["airbnb-base", "plugin:prettier/recommended"],
|
|
// "plugins": ["prettier"],
|
|
// "rules": {
|
|
// "prettier/prettier": "error"
|
|
// }
|
|
// }
|
|
|
|
// eslint-disable-next-line no-undef
|
|
module.exports = {
|
|
root: true,
|
|
extends: [
|
|
'airbnb-base',
|
|
'eslint-config-prettier', // Prefers Prettier's formatting
|
|
// 'prettier',
|
|
// 'plugin:prettier/recommended'
|
|
],
|
|
parser: '@babel/eslint-parser',
|
|
parserOptions: {
|
|
requireConfigFile: false,
|
|
},
|
|
// plugins: ['prettier'],
|
|
rules: getRules(),
|
|
};
|
|
|
|
function getRules() {
|
|
return {
|
|
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
|
// Allows modification of properties passed to functions.
|
|
// Notably used in array.forEach(e => {e.prop = val;})
|
|
'no-param-reassign': ['error', { props: false }],
|
|
// ++ operator widely used
|
|
'no-plusplus': ['off'],
|
|
// Hassio-Plejd team feals _ prefix is great for "private" variables.
|
|
// They will still be available for use from the outside
|
|
'no-underscore-dangle': ['off'],
|
|
// Allow function hoisting to improve code readability
|
|
'no-use-before-define': ['error', { functions: false, classes: true, variables: true }],
|
|
// Allow direct indexing of arrays only (array[0])
|
|
'prefer-destructuring': ['error', { array: false, object: true }],
|
|
};
|
|
}
|