def _mega_bbu_to_lsm(sys_id, bbu_show_all_output) -> Battery:
    design_info = _fix_bbu_cv_output(bbu_show_all_output["BBU_Design_Info"])
    bbu_info = _fix_bbu_cv_output(bbu_show_all_output["BBU_Info"])

    battery_type = Battery.TYPE_CHEMICAL
    name = "LSI BBU: {} {} {} {} {} {}".format(
        design_info["Manufacture Name"],
        design_info["Device Name"],
        design_info["Device Chemistry"],
        design_info["Design Capacity"],
        design_info["Design Voltage"],
        design_info["Date of Manufacture"],
    )
    battery_id = "%s_BBU_%s" % (
        sys_id,
        design_info["Serial Number"],
    )
    status = _bbu_status_to_lsm(bbu_info["Battery State"])
    plugin_data = None

    return Battery(
        battery_id,
        name,
        battery_type,
        status,
        sys_id,
        plugin_data,
    )
Example #2
0
def _mega_cv_to_lsm(sys_id, cv_show_all_output):
    design_info = _fix_bbu_cv_output(cv_show_all_output['Design_Info'])
    cv_info = _fix_bbu_cv_output(cv_show_all_output['Cachevault_Info'])

    battery_type = Battery.TYPE_CAPACITOR
    battery_id = "%s_CV_%s" % (sys_id, design_info['Serial Number'])
    name = "LSI CacheVault: %s %s %s" % (design_info['Device Name'],
                                         design_info['Design Capacity'],
                                         design_info['Date of Manufacture'])
    status = _cv_status_to_lsm(cv_info['State'])

    plugin_data = None

    return Battery(battery_id, name, battery_type, status, sys_id, plugin_data)
Example #3
0
def _mega_bbu_to_lsm(sys_id, bbu_show_all_output):
    design_info = _fix_bbu_cv_output(bbu_show_all_output['BBU_Design_Info'])
    bbu_info = _fix_bbu_cv_output(bbu_show_all_output['BBU_Info'])

    battery_type = Battery.TYPE_CHEMICAL
    name = "LSI BBU: %s %s %s %s %s %s" % (
        design_info['Manufacture Name'], design_info['Device Name'],
        design_info['Device Chemistry'], design_info['Design Capacity'],
        design_info['Design Voltage'], design_info['Date of Manufacture'])
    battery_id = "%s_BBU_%s" % (sys_id, design_info['Serial Number'])
    status = _bbu_status_to_lsm(bbu_info['Battery State'])
    plugin_data = None

    return Battery(battery_id, name, battery_type, status, sys_id, plugin_data)