Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 logging fixes #156

Merged
merged 2 commits into from
Feb 22, 2019
Merged

V3 logging fixes #156

merged 2 commits into from
Feb 22, 2019

Conversation

digitaldan
Copy link
Collaborator

@jsetton logging was not printing the second argument in the log function for me, i ran across this bug winstonjs/winston#1217 on the winston repo that maybe explains why, can you confirm my changes work for you before i merge?

Signed-off-by: digitaldan <dan@digitaldan.com>
Signed-off-by: digitaldan <dan@digitaldan.com>
@jsetton
Copy link
Collaborator

jsetton commented Feb 22, 2019

I am looking into this right now. FYI, I have another big code refactor improvement PR coming your way, in a bit, around Alexa capability settings and property state management. I think you will like it. 😄

@digitaldan
Copy link
Collaborator Author

👍 Awesome, I'm going to open a Bug on something I have a question on , look for it in just a min.

@jsetton
Copy link
Collaborator

jsetton commented Feb 22, 2019

Change looks good. Another option would have been to reintroduce the concatenation of the JSON stringify output to the log message string.

@digitaldan
Copy link
Collaborator Author

I'll merge, i kinda like the simplify of it.

@digitaldan digitaldan merged commit 247e3ba into openhab:v3 Feb 22, 2019
@jsetton
Copy link
Collaborator

jsetton commented Feb 22, 2019

So I found another issue with the logger while doing some test. When the provided object includes a message property, it uses that property as the message. I am going to rename these properties to reason instead. I also confirmed that it is only when that property is at the root level. So none of the Alexa response object should be affected.

Before
error: getPropertiesResponseAndReturn failed with error: {"message":"Invalid item state returned by openHAB","items":[{"name":"switch1","state":"NULL","type":"Switch"}]}

Now
error: Invalid item state returned by openHAB {"items":[{"name":"switch1","state":"NULL","type":"Switch"}]}

digitaldan added a commit that referenced this pull request May 25, 2019
* Alexa Skills API v3, major rewrite

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Formatting changes

Signed-off-by: digitaldan <dan@digitaldan.com>

* Formatting, starting to add support for tag params, change catagories

Signed-off-by: digitaldan <dan@digitaldan.com>

* Major refactoring of cookies, store propertyMap as json in Alexa cookies.  Adds support for tag paramters.

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Fixing mappings

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Updated README, added endpoint and item catgeories from tags

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* more updates

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Renaming alexaControllerProperties.js to alexaContextProperties.js

Signed-off-by: digitaldan <dan@digitaldan.com>

* Adds temp scale to v2 items, cleans up source

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Send numeric values

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Fixes for color setting and reporting

Signed-off-by: digitaldan <dan@digitaldan.com>

* fixing locks

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fix for v3 thermostat handling.

* properties[propertyName.itemName] is undefined
* The cases 'CurrentTemperature' and 'TargetTemperature' seem to be mixed up

Signed-off-by: Frank Meies frank.meies@gmail.com

* Added mocha tests

* Fix group of lights

* Fix setting brightness at color light

* Alexa Response State Accuracy Improvement

* improved Alexa response state accuracy by getting latest openhab state after posting command
* added color hsb state support for brightness, percentage and power state properties
* allowed color hsb state decimal value to be sent to openhab
* added jammed lock state property support
* fixed v2 tag no matching group type capability null exception
* cleaned up few typos & unecessary functions

* Mocha Testing Improvement

* added assert custom function module to simplify unit test creation
* organized discovery & directives test case settings in seperate files to improve readability
* added test cases for most of implemented functionalities
* set log level to error limiting unecessary console output

* Scene Trigger Support

* added supportsDeactivation parameter support (enabled by default)
* fixed scene trigger response based on api reference

* Color Temperature Support

* added color temperature control support
* implemented support for dimmer items to work with hue + lifx (default) and number items for custom integration using the color temperature value

* Thermostat Mode Binding Tag Parameter Support

* added ability to define through tag parameter the binding used in OH (ecobee, nest & zwave bindings currently only defined)
* added default mapping if no binding or custom mapping specified
* recycled deprecated normalize thermostat mode function to handle mapping logic
* fixed thermostat mode context state property format based on api reference
* fixed adjust target temperature function state calculation

* Entertainment Controller Support

* added/improved channel, input, speaker control support
* added ability to define default speaker volume increment through tag parameter
* fixed step speaker context state property format based on api reference

* Mocha Testing Reorganization

* added v2 testing capabilities
* split test case files into v2/v3 folders
* cleaned up test case files format
* added travis configuration
* added default rest config settings fallback logic in case config.js not found

* Connector V2 Support Fix

* updated v2 support after being broken by recent changes
* added v2 test cases for all implemented functionalities

* Readme Updates + Color Temperature Improvement (#64)

* Color Temperature Dimmer Item Increment Tag Parameter Support

* added increment tag parameter support for color temperature dimmer item
* refactored code for generateControlError function

* Readme Updates

* added/updated supported item mapping tag based on recent changes
* cleaned up spelling errors

* Metadata Support

* added metadata openhab functionality support
* added/expanded v2 tag ability with parameters and included in item metadata
* limited group endpoint to alexa supported categories only
* improved display categories determination logic

* Upgrade to latest lambda deploy package

Signed-off-by: digitaldan <dan@digitaldan.com>

* Metadata Support Updates (#69)

* changed core logic based on item metadata object
* moved v3 parameters support through tags to metadata only
* updated concept of metadata labels aligned with v2 tags

* Temperature Sensor Outside Group v2 Category Fix (#71)

* Support user defined Thermostat modes with numeric valuse

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fixes #83 (#114)

Signed-off-by: digitaldan <dan@digitaldan.com>

* V3 travis errors fix (#115)

* Thanks tests!  Fixes bad checks for undefied values

Signed-off-by: digitaldan <dan@digitaldan.com>

* added test to check for numeric value in user map for thermos

Signed-off-by: digitaldan <dan@digitaldan.com>

* Stereo mute fix (#117)

* Thanks tests!  Fixes bad checks for undefied values

Signed-off-by: digitaldan <dan@digitaldan.com>

* added test to check for numeric value in user map for thermos

Signed-off-by: digitaldan <dan@digitaldan.com>

* fixes stereo mute issue

Signed-off-by: digitaldan <dan@digitaldan.com>

* Revert "Stereo mute fix (#117)" (#118)

This reverts commit ea4ca19.

* Update README.md

* Fixes issue reporting thermostat modes (#121)

Signed-off-by: digitaldan <dan@digitaldan.com>

* fixes failing tests (#122)

Signed-off-by: digitaldan <dan@digitaldan.com>

* This adds "comfort ranges"  to thermostats used in dual mode. Fixes #119 (#120)

* This adds "comfort ranges"  to thermostats used in dual mode. Fixes #119

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fixed looping logic

Signed-off-by: digitaldan <dan@digitaldan.com>

* updated readme and renamed tests

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fix StepSpeaker discovery (#99)

* Fix StepSpeaker discovery

* Fix StepSpeaker discovery - test fixed

* Fix StepSpeaker discovery - test fixed

* Closes #128 (#129)

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Update README.md

Closes #124

* Adds editable to rest request to get around oh issue here https://community.openhab.org/t/field-editable-is-required-when-getting-items-on-the-rest-api/65094/5 . (#131)

Fixes #126

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* Adds the original value to be returned when failing map to a alexa mode.  For thermostat modes, this will at least allow ALexa to report arbratray values. (#132)

Signed-off-by: Dan Cunningham <dan@digitaldan.com>

* V3 thermostat supported modes (#133)

* Adds optional supported modes to thermostat

Signed-off-by: digitaldan <dan@digitaldan.com>

* only add config option if we have supportedModes

Signed-off-by: digitaldan <dan@digitaldan.com>

* Update Readme with supportedModes

Signed-off-by: digitaldan <dan@digitaldan.com>

* V3 winston logging (#134)

* Switch to using winston as a logger

Signed-off-by: digitaldan <dan@digitaldan.com>

* better checking of env vars

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fixed typo, use error loggin when running tests

Signed-off-by: digitaldan <dan@digitaldan.com>

* Updating documentation (#136)

* Updating documentation

Signed-off-by: digitaldan <dan@digitaldan.com>

* Small typo

Signed-off-by: digitaldan <dan@digitaldan.com>

* Small change to wording

Signed-off-by: digitaldan <dan@digitaldan.com>

* Still more changes

Signed-off-by: digitaldan <dan@digitaldan.com>

* Group item with no tag discovery fix (#83) (#135)

* Update README.md

* Update USAGE.md

* Update USAGE.md

* Update USAGE.md

* Update USAGE.md

* Fixes an error with how modes can be mapped (#137)

Signed-off-by: digitaldan <dan@digitaldan.com>

* Property Response Improvements (#138)

* Property Response Improvements

* improved property map object with prototype functions along with item type per capability enforcement
* updated alexa response property state accuracy logic with ability to associate an item sensor through metadata parameter
* added ability to define lock property state mapping when using an item sensor through metadata parameter
* updated temperature mode binding mapping to differentiate legacy bindings from latest one
* refactored rest functions code to accomodate for future alexa gateway calls
* changed the lambda function return method to use handler callback instead of context
* updated report state function to use generic alexa response property state logic

* Thermostat mode property not defined capabilities prototype bug fix

* Item State Presentation Format Support (#141)

* Remove v2 logic from code (#144)

* Move to using request library and native promises for all rest calls (#145)

* Move to using request library and native promises for all rest calls

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fixed typo

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fixing merge conflicts

Signed-off-by: digitaldan <dan@digitaldan.com>

* Update config file

Signed-off-by: digitaldan <dan@digitaldan.com>

* Move to nodejs 8.10

Signed-off-by: digitaldan <dan@digitaldan.com>

* Fix temperature conversion for thermostats (#146)

*  Item Scale Unit of Measurement Support (#148)

* Item Scale Unit of Measurement Support

* Updated item state normalization to only occur when pattern defined

* Fix tag values not displayed in USAGE.md

* Contact and Motion Sensors Support (#149)

* added generic property state normalization function returning relevant alexa state
* updated item state normalization to only occur when pattern and state defined
* updated display categories list

*  Alexa Response Customization Framework Improvements (#150)

* Alexa Response Customization Framework Improvements

* corrected namespace on interface specific error reponse messages
* decamilized endpoint group name to match display categories format

* code cleanup

* Channel Control Request By Name Improvement (#151)

* Additional code refactoring (#152)

* Limit item state normalization to only process numerical format placeholders (#154)

* V3 logging fixes (#156)

* Fixed logging to support object printing

Signed-off-by: digitaldan <dan@digitaldan.com>

* added back in setting log level in test

Signed-off-by: digitaldan <dan@digitaldan.com>

* Usage updates to point our other Alexa integration, better description of the skill (#158)

Signed-off-by: digitaldan <dan@digitaldan.com>

* Major code refactoring (#160)

* improved alexa capability settings and property state normalization management
* improved alexa response data validation
* moved alexa directives support into seperate classes
* added alexa property schema concept to manage property states
* updated input controller to latest api changes
* renamed thermostat setpoint comfort range parameter to use camelcase format
* removed playback support for stop operation in line with player item type command support
* added ability to use openhab regional settings to determine temperature scale
* added log error test capture preventing unecessary output during successful test units
* added alexa official json schema validation to test suite
* restructed project folders

* Mode Range Toggle Controller Support (#162)

* Mode Range Toggle Controller Support

* added multi-instance support to accomodate for the new capabilities
* improved test suite to check for new standard capabilities parameters
* revamped unit of measurement support
* removed power level unecessary normalize function
* added kelvin temperature conversation normalization

* Removed asset id prefix requirement allowing usage in supported modes configuration

* Combined range supported presets parameters configuration into one

* Updated supported modes and presets configuration resources format

* Security Panel Controller Support (#166)

* Security Panel Controller Support

* Added ability to restrict the properties included in response context
* Added ability to trigger an error reponse based on properties response name and value
* Moved supported property states into schema config object
* Fixed object not properly cloned causing some reference objects to be unecessarily updated

* Improved error handling including troubleshooting documentation

* add table of contents (#167)

Signed-off-by: digitaldan <dan@digitaldan.com>

* Equalizer Controller Support (#168)

* added ability to configure sub-property components to accommodate  new capability
* added ability to report a property under a different name than the one defined in discovery
* added logic to determine thermostat binding 2.x parameter based on item channel metadata
* added logic to determine mode range toggle friendly names based on item synonyms metadata
* fixed log array object representation issue due to winston limitation
* fixed discovery test directive request incorrectly including header correlation token
* added schema validation to discovery test cases
* updated validation json schema
* moved mocha options into standard config file

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* Remove tag examples for metadata labels, add metadata examples in beg… (#169)

* Remove tag examples for metadata labels, add metadata examples in begining of page

Signed-off-by: digitaldan <dan@digitaldan.com>

* Expanded v2 support documentation

Signed-off-by: digitaldan <dan@digitaldan.com>

* fixed link typo

Signed-off-by: digitaldan <dan@digitaldan.com>

* Typo

Signed-off-by: digitaldan <dan@digitaldan.com>

* moved other integrations to bottom of page

Signed-off-by: digitaldan <dan@digitaldan.com>

* added additional explaination to v2 tags

Signed-off-by: digitaldan <dan@digitaldan.com>

* Update documentation (#172)

Signed-off-by: digitaldan <dan@digitaldan.com>

* Alexa Skills Kit CLI Deployment Support (#175)

* Alexa Skills Kit CLI Deployment Support

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* Added ESLint configuration + lint cleanup

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* Remove SecurityPanelController arm instant support (#180)

* Remove SecurityPanelController arm instant support

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* Update Alexa validation schema

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* StepSpeaker Controller Volume Steps Command Value Fix (#182)

* Seperated volume property schema to differentiate the two speaker capabilities
* Added support for default volume steps increment metadata parameter
* Improved context response for non-reportable properties
* Improved invalid directive error handling when relevant property map settings not defined
* Minor code and documentation cleanup

Signed-off-by: jsetton <jeremy.setton@gmail.com>

* revert file

Signed-off-by: digitaldan <dan@digitaldan.com>

* Update Readme to use master for travis status

Signed-off-by: digitaldan <dan@digitaldan.com>

* Update install directions to use master branch

Signed-off-by: digitaldan <dan@digitaldan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants