import requests

class RPIService:
    def __init__(self, ip_addr: str):
        self.api_addr = f"http://{ip_addr}:8000"

    def clear_lcd(self):
        endpoint = self.api_addr + "/lcd/clear"
        requests.post(endpoint, self.api_addr)

    def send_message(self, line_1_msg: str, line_2_msg):
        data = [line_1_msg[:16], line_2_msg[:16]]
        endpoint = self.api_addr + "/lcd/message"
        requests.post(endpoint, json=data)