/// add a new home to SmartHub
///
/// # Safety
///
/// handle gets from smart_home_new()
///
/// * `handle`: smart hub handle
/// * `name`: home name to add
add a new home to SmartHub
add a new home to SmartHub
pub unsafe extern "C" fn smart_home_add_home(
    handle: *mut Handle,
    name: *const c_char,
) -> *mut Home {
    let handle = &mut *handle;
    let home_name = CStr::from_ptr(name).to_str().unwrap();
    match handle.controller.add_home(Home::new(home_name)) {
        Ok(home) => home as *mut Home,
        Err(_) => std::ptr::null_mut(),
    }
}
pub unsafe extern " " fn smart_home_add_home ( handle : * mut Handle , name : * const c_char , ) -> * mut Home { let handle = & mut * handle ; let home_name = CStr :: from_ptr ( name ) . to_str ( ) . unwrap ( ) ; match handle . controller . add_home ( Home :: new ( home_name ) ) { Ok ( home ) => home as * mut Home , Err ( _ ) => std :: ptr :: null_mut ( ) , } }
add a new home to SmartHub
add a new home to SmartHub
handle
*mut Handle
name
*const c_char
safety
handle gets from smart_home_new()

`handle`: smart hub handle
`name`: home name to add
handle gets from smart_home_new () ` handle ` : smart hub handle ` name ` : home name to add