Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'repeat/until'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 1 result

  1. When I plugin the plug in the power socket from my denon receiver, internally the unit is initializing different settings, like network, etc... when i plugin the unit, the receiver is set to standby, ok. I want to make a lua code whereby it makes a loop with repeat / until...until i get a code back from the unit if it's in standby mode, or on mode, from there it should continue, see below. but it's skips the repeat/until... When the unit is plugged in, no code is been returned... So i was thinking: instead of this: "if not(trim(result) == "PWON" or "PWSTANDBY") then" use "if (trim(result) == """) then" Are there other ways to detect an empty string ? With other words: When no code is been returned, stay in this loop until PWON or PWSTANDBY is been returned. fibaro:log("Connecting..."); tcpSocket = Net.FTcpSocket("10.0.1.155", 23); tcpSocket:setReadTimeout(1000); function trim(s) -- trim leading and trailing whitespaces -- return (s:gsub("^%s*(.-)%s*$", "%1")) end -- Denon is Initializing it's Network -- repeat fibaro:sleep(2000); tcpSocket:write(string.char(0x50, 0x57, 0x3f, 0x0d)); -- requesting for the PWON or PWSTANDBY status ? fibaro:sleep(500); result, err = tcpSocket:read(); tcpSocket:disconnect(); fibaro:debug("Denon Receiver..."..result); if (err == 0) then if not(trim(result) == "PWON" or "PWSTANDBY") then fibaro:sleep(1000) fibaro:debug("...is Initializing"); end end until (trim(result) == "PWON" or "PWSTANDBY") fibaro:debug("Ready to Receive Data: "..result); -- Rest of the code -- Please some help would be appreciated. Thankss a lot
×
×
  • Create New...