def cli( ctx: Configuration, verbose: bool, server: str, token: Optional[str], password: Optional[str], output: str, timeout: int, debug: bool, insecure: bool, showexceptions: bool, cert: str, columns: str, no_headers: bool, table_format: str, sort_by: Optional[str], ) -> None: """Command line interface for Home Assistant.""" ctx.verbose = verbose ctx.server = server ctx.token = token ctx.password = password ctx.timeout = timeout ctx.output = output ctx.debug = debug ctx.insecure = insecure ctx.showexceptions = showexceptions ctx.cert = cert ctx.columns = to_tuples(columns) ctx.no_headers = no_headers ctx.table_format = table_format ctx.sort_by = sort_by # type: ignore _LOGGER.debug("Using settings: %s", ctx) if debug: debug_requests_on()
def test_to_tuples_no_header(): """Test to_tuples without header.""" data = helper.to_tuples("entity_id,state") assert len(data) == 2 assert data[0] == ("entity_id",) assert data[1] == ("state",)
def test_to_tuples(): """Basic title test on to_tuples.""" data = helper.to_tuples("a=entity_id,b=state") assert len(data) == 2 assert data[0] == ("a", "entity_id") assert data[1] == ("b", "state")
def test_to_tuples_no_header(): """Test to_tuples without header.""" data = helper.to_tuples("entity_id,state") assert len(data) == 2 assert data[0] == ("entity_id", ) assert data[1] == ("state", )