Webapi

Example code

class Config(ConfigObject):

    def config(self):
        config = {}
        
        # Zwave
        config["webapi"] = {}
        config["webapi"]["min_time_between_fails"] = 300 # Min time between each failed attempt in seconds (default 300)
        config["webapi"]["min_fails"] = 5 # Min attempts before getting blacklisted (default 5)
        config["webapi"]["min_blacklist_time"] = 18000 # Min time until blacklist is lifted (default 18000)
        
        return config

    def setup(self):
        # zwave devices --------------------------------------------------------
        self.api_token = EventObject("webapi", "te1LB-VNj_kVruP3mACnO2wGYBtTl2o1n7Ji6L8ASGg")
        
        
    def process_event(self):
        if self.api_token.event == "something":
            #Do something

You can generate tokens with the secrets package like this.

import secrets
print(secrets.token_urlsafe(32))