"""test_raspberry_pi.py - Test routines and sample code for communicating via LAN or RS232 with NEC large-screen displays
using the NEC PD SDK.
Revision: 180220
"""
#
#
# Copyright (C) 2016-18 NEC Display Solutions, Ltd
# written by Will Hollingworth <whollingworth at necdisplay.com>
# See LICENSE.rst for details.
#


from __future__ import print_function
from builtins import input
import logging
from nec_pd_sdk.nec_pd_sdk import NECPD
from nec_pd_sdk.protocol import PDError
from nec_pd_sdk.protocol import PDUnexpectedReplyError
from nec_pd_sdk.constants import *
from nec_pd_sdk.opcode_decoding import *


def reverse_dict(d):
    return dict(list(zip(list(d.values()), list(d.keys()))))


def do_main_tests(pd):
    try:
        print("Testing: helper_asset_data_read")
        value = pd.helper_asset_data_read()
        print("helper_asset_data_read value: ", value)

        print("Testing: command_model_name_read")
        value = pd.command_model_name_read()
        print("command_model_name_read value:", value)

        print("Testing: command_serial_number_read")
        value = pd.command_serial_number_read()
        print("command_serial_number_read value:", value)

        print("Testing: command_lan_mac_address_read")
        value = pd.command_lan_mac_address_read()
        print("command_lan_mac_address_read value:", value[0])

        print("Testing: command_ip_address_read")
        value = pd.command_ip_address_read()
        print("command_ip_address_read value:", value[0])

        print("Testing: helper_get_power_on_hours")
        print("power on hours: ", pd.helper_get_power_on_hours())

        print("Testing: helper_get_total_operating_hours")
        print("total operating hours: ", pd.helper_get_total_operating_hours())