Skip to content

Commit

Permalink
First release for wb2ih
Browse files Browse the repository at this point in the history
  • Loading branch information
avp-avp committed Jan 29, 2017
1 parent e680865 commit 6d56462
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libutils/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ CLog* CLog::GetLog(string Name)
if (pos>0)
m_BasePath = m_BasePath.substr(0, pos+1);
#else
m_BasePath = ".";
// m_BasePath = "/run/";
// m_BasePath = ".";
m_BasePath = "/run/";
#endif

log->Open((m_BasePath+Name+".log").c_str());
Expand Down
17 changes: 10 additions & 7 deletions libwb/WBDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ const char *g_Topics[] =
"value",
"temperature",
"rel_humidity",
"pressure",
"atmospheric_pressure",
"sound_level",
"PrecipitationRate", //(rainfall rate) rainfall mm per hour float
"WindSpeed", // wind_speed m / s float
"PowerPower", // watt float
"PowerConsumption", // power_consumption kWh float
"VoltageVoltage", // volts float
"WaterFlow", // water_flow m ^ 3 / hour float
"voltage", // volts float
"water_flow", // water_flow m ^ 3 / hour float
"WaterTotal", // consumption water_consumption m ^ 3 float
"Resistance", // resistance Ohm float
"GasConcentration", // concentration ppm float(unsigned)
"resistance", // resistance Ohm float
"concentration", // concentration ppm float(unsigned)

"",
};
Expand Down Expand Up @@ -94,6 +94,9 @@ string CWBControl::getTypeName()
void CWBControl::setType(const string& type)
{
Type = getType(type);

if (Type == Error && type != "" && type != "Error")
throw CHaException(CHaException::ErrBadParam, "Unknown device type '%s'", type.c_str());
}

bool CWBControl::isLoaded()
Expand Down Expand Up @@ -271,7 +274,7 @@ void CWBDevice::setBySource(string source, string sourceType, string Value)
}
}

void CWBDevice::subscribeToEntich(string_vector &v)
void CWBDevice::subscribeToEnrich(string_vector &v)
{
if (m_Description.size()==0)
v.push_back("/devices/" + m_Name+ "/meta/#");
Expand Down Expand Up @@ -313,4 +316,4 @@ bool CWBDevice::isLoaded()
}

return true;
}
}
2 changes: 1 addition & 1 deletion libwb/WBDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class LIBWB_API CWBDevice
void updateValues(string_map &);
const CControlMap *getControls(){return &m_Controls;};
string getTopic(string Control);
void subscribeToEntich(string_vector &v);
void subscribeToEnrich(string_vector &v);
void enrichDevice(const string &meta, const string &val);
void enrichControl(const string &control, const string &meta, const string &val);
bool isLoaded();
Expand Down

0 comments on commit 6d56462

Please sign in to comment.