#212 Home Assistant Integration - #729
Conversation
|
🎉 Beta deployment successful!: view the changes in live preview environment: https://gridbeta-github.asterics-foundation.org/ALRAARLA/212-home-assistant-integration/pr |
klues
left a comment
There was a problem hiding this comment.
Thanks, please see my review comments.
There was a problem hiding this comment.
please revert this file, I think no changes needed here.
There was a problem hiding this comment.
I think also this file is not needed, so remove/revert it
|
|
||
| homeAssistantService.sendAction = async function (action) { | ||
| try { | ||
| const base = (action.homeAssistantUrl || 'http://192.168.0.230:8123').replace(/\/api.*$/, '').replace(/^https:/, 'http:'); |
There was a problem hiding this comment.
better use http://homeassistant.local:8123 as fallback
There was a problem hiding this comment.
please only change the file i18n.en.json and revert all changes in the other translation files.
There was a problem hiding this comment.
also not needed, remove/revert please.
| homeAssistantService.getRestURL = function (userUri) { | ||
| if (!userUri) { | ||
| userUri = window.location.hostname.indexOf('grid.asterics.eu') > -1 | ||
| ? 'http://192.168.0.230:8123/api/states' |
There was a problem hiding this comment.
Also here we have a fixed IP address.
| function mapActionToService(actionType) { | ||
| if (!actionType) return 'toggle'; | ||
| const t = actionType.toString().toUpperCase(); | ||
| if (t === 'ON' || t === 'TURN_ON') return 'turn_on'; |
There was a problem hiding this comment.
I don't understand why you're using constants like ON or TURN_ON here and mapping it to the home assistant service constants here. Why not using the home assistant strings like turn_on everywhere in the first place (also at defining the actions)?
| <input class="col-12" id="inputHomeAssistantUri" | ||
| v-model="action.homeAssistantUrl" | ||
| type="text" | ||
| placeholder="http://192.168.0.230:8123"> |
#212