steps39 / dtgbot

Telegram Bot for Domoticz
19 stars 18 forks source link

dtgbot assumes crashes when no rooms present in Domoticz #2

Closed steps39 closed 7 years ago

steps39 commented 8 years ago

[code]/usr/bin/lua5.2: /home/pi/dtgbot//dtg_domoticz.lua:125: attempt to get length of global 'result' (a nil value) stack traceback: /home/pi/dtgbot//dtg_domoticz.lua:125: in function 'device_list_names_idxs' /home/pi/dtgbot/dtgbot.lua:175: in function 'dtgbot_initialise' /home/pi/dtgbot/dtgbot.lua:229: in main chunk [C]: in ?[/code]

And this my dtb.log [code]2015-08-28 00:52:24 - DomoticzIP: xxx.xxx.xxx.xxx 2015-08-28 00:52:24 - DomoticzPort: xxxx 2015-08-28 00:52:24 - BotHomePath: /home/pi/dtgbot/ 2015-08-28 00:52:24 - BotLuaScriptPath: /home/pi/dtgbot/lua/ 2015-08-28 00:52:24 - BotBashScriptPath: /home/pi/dtgbot/bash/ 2015-08-28 00:52:24 - TelegramBotToken: xxxxxxxxxxxxxxxxxxxxxxxxx 2015-08-28 00:52:24 - TelegramBotOffset: TelegramBotOffset 2015-08-28 00:52:24 - ----------------------------------------- 2015-08-28 00:52:24 - Starting Telegram api Bot message handler 2015-08-28 00:52:24 - ----------------------------------------- 2015-08-28 00:52:24 - Domoticz returned getuservariables after 1 attempts [/code]