seems like constant mapping. so you can have something like
```
WLAN_KEY_MAP = {
  "password" => "h:",
  "ascii" => "s:"
}

#and in code
type = WLAN_KEY_MAP[wlan_key_type] || ""
```