Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
fikin committed Sep 27, 2023
1 parent eb3b876 commit 15ed990
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions integration-tests/lua/testInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ local function assertHassInfo()
local r = 'GET /api/ha/info HTTP/1.0\r\nAuthorization: Basic aGFzczphZG1pbg==\r\n\r\n'
local e = 'HTTP/1.0 200 OK\r\n' ..
'Cache-Control: private, no-cache, no-store\r\n' ..
'Content-Length: 120\r\n' ..
'Content-Length: 135\r\n' ..
'Content-Type: application/json\r\n' ..
'\r\n' ..
'{"hwVersion":"1.0.0","manufacturer":"fikin","model":"WeMos D1 mini","name":"nodemcu1234567890","swVersion":"1669271656"}'
'{"hwVersion":"1.0.0","manufacturer":"Noname vendor","model":"Generic NodeMCU make","name":"nodemcu1234567890","swVersion":"1669271656"}'
assert200HttpRequest(r, e)
end

Expand Down
2 changes: 2 additions & 0 deletions lua_modules/temp-sensor/lua/temp-sensor-get.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ local function getState()
return require("state")("temp-sensor")
end

---returns temp-sernsor current value stored in state
---@return number
local function getTemp()
package.loaded[modname] = nil

Expand Down
2 changes: 1 addition & 1 deletion lua_modules/thermostat/lua/thermostat-control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ local function handleHvacMode()
local mode = state.data.hvac_mode
if mode == "off" then
ensureIsOff()
elseif mode == "on" then
elseif mode == "heat" then
ensureIsOn()
elseif mode == "auto" then
ensureIsAuto()
Expand Down
11 changes: 6 additions & 5 deletions lua_modules/thermostat/lua/thermostat-start.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ local modname = ...
local log = require("log")

---@class thermostat_cfg_mode_cfg
---@field target_temperature_high integer
---@field target_temperature_low integer
---@field target_temperature_high number
---@field target_temperature_low number

---@class thermostat_cfg_mode
---@field away thermostat_cfg_mode_cfg
Expand All @@ -26,17 +26,18 @@ local log = require("log")

---@class thermostat_cfg_data
---@field temperature_unit string
---@field target_temperature_high integer
---@field target_temperature_low integer
---@field target_temperature_high number
---@field target_temperature_low number
---@field hvac_mode string
---@field hvac_modes string[]
---@field preset_mode string
---@field preset_modes string[]
---@field supported_features integer
---@field current_temperature number
---@field hvac_action string provided by HASS when setting other values

---@class thermostat_cfg
---@field periodMs integer
---@field tempSensorPin integer
---@field relayPin integer
---@field modes thermostat_cfg_mode[]
---@field data thermostat_cfg_data
Expand Down
4 changes: 2 additions & 2 deletions lua_modules/web-ha/lua/web-ha.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ local modname = ...
---@param conn http_conn*
local function getInfo(conn)
local data = {
manufacturer = "fikin",
manufacturer = "Noname vendor",
name = require("wifi").sta.gethostname(),
model = "WeMos D1 mini",
model = "Generic NodeMCU make",
swVersion = require("get-sw-version")().version,
hwVersion = "1.0.0"
}
Expand Down

0 comments on commit 15ed990

Please sign in to comment.